Skip to content

Instantly share code, notes, and snippets.

@kwstannard
Last active August 29, 2015 14:12
Show Gist options
  • Save kwstannard/c8b077086a7d152a69ab to your computer and use it in GitHub Desktop.
Save kwstannard/c8b077086a7d152a69ab to your computer and use it in GitHub Desktop.
[4] pry(main)> mod = Module.new
=> #<Module:0x007fa1ac93c650>
[5] pry(main)> mod::Foo = Class.new
=> #<Class:0x007fa1ae5ad7f8>
[6] pry(main)> mod::Foo
=> #<Class:0x007fa1ae5ad7f8>
[7] pry(main)> mod::Foo.parent
=> Object
@metin
Copy link

metin commented Jan 2, 2015

👊

@dholdren
Copy link

dholdren commented Jan 5, 2015

this is because:

mod::Foo.name
 => nil

And the .parent method in activesupport does regex on the .name to pull out the module name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment