From: Pat Maddox Date: 2006-05-14T15:42:47+09:00 Subject: Re: Making sense of the various Ruby "eval"s I genuinely have no clue what the difference is between class_eval and instance_eval. Check out this quick irb session: irb(main):111:0> class Foo; end => nil irb(main):112:0> Foo.instance_eval { define_method(:foo) { "foo" } } => # irb(main):113:0> Foo.foo NoMethodError: undefined method `foo' for Foo:Class from (irb):113 from :0 irb(main):114:0> Foo.new.foo => "foo" irb(main):115:0> class Bar; end => nil irb(main):116:0> Bar.class_eval { define_method(:bar) { "bar" } } => # irb(main):117:0> Bar.bar NoMethodError: undefined method `bar' for Bar:Class from (irb):117 from :0 irb(main):118:0> Bar.new.bar => "bar" I would think that since I used class_eval in one and instance_eval in the other, SOMETHING should be different.. Pat