Skip to content

Instantly share code, notes, and snippets.

@ELLIOTTCABLE
Forked from Mikoangelo/gist:13186
Created September 26, 2008 20:06
Show Gist options
  • Save ELLIOTTCABLE/13190 to your computer and use it in GitHub Desktop.
Save ELLIOTTCABLE/13190 to your computer and use it in GitHub Desktop.
class Foo
def initialize &block
p instance_eval &block if block_given? # !> `&' interpreted as argument prefix
end
def const_missing const
"foobar"
end
end
Foo.new {self} # => #<Foo:0x27204>
# should be
(class << Foo.new; self; end) # => #<Class:#<Foo:0x27038>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment