Advertisement
Guest User

Untitled

a guest
Apr 14th, 2013
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.24 KB | None | 0 0
  1. class Foo
  2.  
  3.   BAR = {a: 0}
  4.  
  5.   def initialize
  6.     @whatever = BAR
  7.     #...
  8.     @whatever[:a] += 1
  9.     puts @whatever[:a]
  10.   end
  11.  
  12. end
  13.  
  14. Foo.new #output: 1
  15. Foo.new #output: 2
  16. Foo.new #output: 3
  17. Foo.new #output: 4
  18. Foo.new #output: 5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement