Skip to content

Instantly share code, notes, and snippets.

View matiasdim's full-sized avatar

Matías matiasdim

View GitHub Profile
def nombre_funcion(usuario)
@usuario = usuario
mail to: usuario.email, subject: 'Bienvenido.’
end
def nombre_funcion(usuario)
@usuario = usuario
mail to: usuario.email, subject: 'Bienvenido.’
end
@matiasdim
matiasdim / test.swift
Created December 2, 2020 15:14
Swift gist test
let test = "Test"
print("test")
@matiasdim
matiasdim / SingleResponsability.swift
Last active December 2, 2020 20:22
Single-Responsability(Broken)
class Employee {
let name: String
let email: String
init(_ name: String, _ email: String) {
self.name = name
self.email = email
}
func getInfo() -> String {
@matiasdim
matiasdim / SingleResponsability.swift
Created December 2, 2020 20:22
Single-Responsability
class Employee {
let name: String
let emailAddress: EmailAddress
init(name: String, emailAddress: EmailAddress) {
self.name = name
self.emailAddress = emailAddress
}
func getInfo() -> String {
class Rectangle {
var width: Int
var height: Int
init(width: Int, height: Int) {
self.width = width
self.height = height
}
}
class Circle {
var radius: Int
init(radius: Int) {
self.radius = radius
}
}
class Rectangle {
var width: Int
protocol GeometricFigure {
func area() -> Double
}
class Circle: GeometricFigure {
var radius: Double
init(radius: Double) {
self.radius = radius
}
class Rectangle {
var width: Double
var height: Double
init(width: Double, height: Double) {
self.width = width
self.height = height
}
func area() -> Double {
protocol ATM {
func depositMoney()
func withdrawMoney()
}
// Simple ATM Machine CANNOT deposit money
class simpleATM: ATM {
func depositMoney() {
// This method is not used for this class, since it does not have this capability
}