-
-
Save ss2k/8eec94d19ce57f0b9404 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 Test | |
def add | |
end | |
end | |
test = Test.new | |
test.add(50) | |
p test.scores # [50] | |
test.add(60) | |
p test.scores # [50,60] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
def initialize
@scores = [ ]
end
def add(val)
@scores << val
end
attr_reader :scores