Advertisement
saasbook

attr_accessor_with_history.rb

Jan 10th, 2012
689
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.19 KB | None | 0 0
  1. class Foo ; attr_accessor_with_history :bar ;  end
  2. => nil
  3. f = Foo.new
  4. => #<Foo:0x127e678>
  5. f.bar = 3
  6. => 3
  7. f.bar = :wowzo
  8. => :wowzo
  9. f.bar = 'boo!'
  10. => 'boo!'
  11. f.history(:bar)
  12. >> [3, :wowzo, 'boo!']
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement