Topic: Understanding Modules
I understand the way these things are working but I don't really
understand what's going on and why.
>> Foo.zim # works, OK, fair enough
>> Foo::zim # works, but why have two syntaxes that do the same?
>> Foo.bar # NoMethodError. Shouldn't this work though? What if I had a procedural API that I wanted to namespace: -
SomeNamespace.function_from_procedural_api # this ain't gonna work!
SomeNamespace::function_from_procedural_api # nor is this
>> SomeClass.new.bar # OK, it's been mixed in
>> SomeClass.zim # NoMethodError, huh? Why doesn't this work?
>> SomeClass.new.zim # NoMethodError. So where has the zim definition actually gone? Doesn't it get included at all?
I'm very confused by all this. Please help unravel the mess in my brain.