T
timr
#lets give strings the ability to evaluate theirselves as if in irb.look at me
=> nil
#good looks like strings can interpret theirselves. But how about this
case?
NameError: uninitialized constant Pumpkin
from (irb):287
from /usr/local/bin/irb:12:in `<main>'
#not flying. Is it a problem with the string? Try with eval of the
same string:
=> #<Pumpkin:0x109896c>
No problem evaluating the class definition in a string. So eval
behaves differently inside a method definition.
Could anyone please explain that?
Thanks in advance,
Tim
=> nil
#good looks like strings can interpret theirselves. But how about this
case?
NameError: uninitialized constant Pumpkin
from (irb):287
from /usr/local/bin/irb:12:in `<main>'
#not flying. Is it a problem with the string? Try with eval of the
same string:
=> #<Pumpkin:0x109896c>
No problem evaluating the class definition in a string. So eval
behaves differently inside a method definition.
Could anyone please explain that?
Thanks in advance,
Tim