Created
March 18, 2013 00:20
-
-
Save avgerin0s/5184234 to your computer and use it in GitHub Desktop.
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 | |
# Creates getters and setters for num1 and num2 | |
attr_accessor :num1, :num2 | |
def initialize(num1, num2) | |
@num1 = num1 | |
@num2 = num2 | |
end | |
def add | |
#string interpolation | |
puts "#{@num1 + @num2}" | |
end | |
end | |
c = Calc.new(1,2) | |
c.add |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment