Skip to content

Instantly share code, notes, and snippets.

@javierav javierav/calc.rb
Last active Aug 29, 2015

Embed
What would you like to do?
Calculadora Curso de Git
class Calc
def initialize(a, b)
@a = a
@b = b
end
end
class Calc
def initialize(a, b)
@a = a
@b = b
end
def sum
@a + @b
end
def subtraction
@a - @b
end
def multiplication
@a * @b
end
def division
@a / @b unless @b == 0
end
end
class Calc
def initialize(a, b)
@a = a
@b = b
end
def sum
@a + @b
end
def subtraction
@a - @b
end
def multiplication
@a * @b
end
def mod
@a % @b
end
end
class Calc
def initialize(a, b)
@a = a
@b = b
end
def sum
@a + @b
end
def multiplication
@a * @b
end
end
class Calc
def initialize(a, b)
@a = a
@b = b
end
def sum
@a + @b
end
def subtraction
@a - @b
end
end
class Calc
def initialize(a, b)
@a = a
@b = b
end
def sum
@a + @b
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.