Skip to content

Instantly share code, notes, and snippets.

@iancoffey
Last active August 29, 2015 14:10
Show Gist options
  • Save iancoffey/2494f5352a2c701f2cfa to your computer and use it in GitHub Desktop.
Save iancoffey/2494f5352a2c701f2cfa to your computer and use it in GitHub Desktop.
irb(main):013:0> module A
irb(main):014:1> module B
irb(main):015:2> def self.something
irb(main):016:3> new()
irb(main):017:3> end
irb(main):018:2> end
irb(main):019:1> end
=> :something
irb(main):020:0> A::B.something
NoMethodError: undefined method `new' for A::B:Module
from (irb):16:in `something'
from (irb):20
from /Users/icoffey/.rbenv/versions/2.1.2/bin/irb:11:in `<main>'
@theunraveler
Copy link

>> module A
>> module B
>> def self.new
>> puts 'Hi'
>> end
>> end
>> end
=> :new
>> A::B.new

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