-
-
Save ELLIOTTCABLE/13190 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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