Skip to content

Instantly share code, notes, and snippets.

@Mikoangelo
Created September 26, 2008 19:44
Show Gist options
  • Save Mikoangelo/13186 to your computer and use it in GitHub Desktop.
Save Mikoangelo/13186 to your computer and use it in GitHub Desktop.
>> class Foo
>> def initialize &block
>> instance_eval &block
>> end
>> def const_missing const
>> "foobar"
>> end
>> end
=> nil
>> Foo.new do RandomConstant end
NameError: uninitialized constant RandomConstant
from (irb):9
from (irb):3:in `instance_eval'
from (irb):3:in `initialize'
from (irb):9:in `new'
from (irb):9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment