Last active
August 29, 2015 14:14
-
-
Save javierav/8f7339f7609238139495 to your computer and use it in GitHub Desktop.
Calculadora Curso de Git
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Calc | |
def initialize(a, b) | |
@a = a | |
@b = b | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Calc | |
def initialize(a, b) | |
@a = a | |
@b = b | |
end | |
def sum | |
@a + @b | |
end | |
def multiplication | |
@a * @b | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Calc | |
def initialize(a, b) | |
@a = a | |
@b = b | |
end | |
def sum | |
@a + @b | |
end | |
def subtraction | |
@a - @b | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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