On Jul 8, 3:31 pm, diego scataglini <dwebsub... / gmail.com> wrote:
> I believe that changes to a class don't modify its already existing
> instances. But you can always add and remove behavior of an object.

C:\>irb
irb(main):001:0> class Foo; def sq(x) x*x end; end
irb(main):002:0> f = Foo.new
irb(main):003:0> f.sq( 12 )
=> 144

irb(main):004:0> class Foo; def double(x) x+x end; end
irb(main):005:0> f.double( 21 )
=> 42

irb(main):006:0> class Foo; def sq(x) x*x*x end; end
irb(main):007:0> f.sq( 12 )
=> 1728