Skip to content

Instantly share code, notes, and snippets.

@dchelimsky
Created July 23, 2010 03:44
Show Gist options
  • Save dchelimsky/486978 to your computer and use it in GitHub Desktop.
Save dchelimsky/486978 to your computer and use it in GitHub Desktop.
class Foo
class Bar; end
end
anonymous_sub = Class.new(Foo) do
def check
Bar
end
end
class FooSub < Foo
def check
Bar
end
end
FooSub.new.check
# => nil
anonymous_sub.new.check
# => NameError: uninitialized constant Bar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment