Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Module.nesting strangeness

Thread Tools

Module.nesting strangeness

Alexandre Mutel
Posts: n/a
i'm encountering a weird behavior of the Module.nesting methodd. Here is
my testcase from the irb:


class A
class B
def test()
puts "Module.nesting : " + Module.nesting * ","
=> nil

b =
=> #<A::B:0x24102d8>

Module.nesting : A::B,A
=> nil

b.instance_eval { puts "Module.nesting : " + Module.nesting * "," }
Module.nesting :
=> nil

The documentation says : "Returns the list of Modules nested at the
point of call. ". But how Module.nesting in test() method knows that it
was declared inside the class A/classB and not outside?
Posted via

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
VLAN strangeness PabloFiasko Cisco 0 06-01-2005 09:05 AM
Bookmarks Strangeness Drude Firefox 0 01-26-2005 01:28 AM
OT: Friday strangeness Ken Briscoe MCSE 6 05-30-2004 08:19 AM
Strangeness in bookmarks are still occurring Keith Bowes Firefox 0 01-06-2004 11:18 PM
autoincrement strangeness - please help! Munnki Perl 2 12-18-2003 10:51 PM