fork download
  1. class Foo
  2. attr_reader :scores
  3.  
  4. def initialize
  5. @scores = []
  6. end
  7.  
  8. def add(score)
  9. @scores << score
  10. end
  11. end
  12.  
  13. a = Foo.new
  14. a.add 50
  15. a.add 60
  16. puts a.scores
Success #stdin #stdout 0.01s 7408KB
stdin
Standard input is empty
stdout
50
60