Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Ruby
newbie q on class Foo::Bar
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="matt neuburg, post: 4534017"] What's the point of a class-within-a-class? For example, I take it that I can say: class Foo class Bar def whatever ... And then I can say my_foo_bar = Foo::Bar.new For example, isn't that what something like File::Stat is? My question is, am I right about this, and if so, what's the point of doing so? I take it that Bar is not magically related to Foo - it can't see Foo's methods or anything like that, can it? So is this merely a way of using a class (Foo) as a namespace so that related classes (like Bar) are all in one place? Thx - m. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Ruby
newbie q on class Foo::Bar
Top