After reading several posts regarding this ruby koans scoping problem, read first, I found myself asking a question:
What is the advantage of being able to define a subclass say class Oyster
in the form of say class MyAnimals::Oyster < Animal
rather than nested in the Animal
class? As this is a contrived example, I don't expect this to be explained using this example, but as I try to understand scope, I imagine there is a usefulness to having the nested lexical scope as having priority over inherited hierarchy. I think another question that gets at my confusion (which may be answered in a later koan) is does class MyAnimals::Oyster < Animal
insides lie in the Animal
class in a subclass of MyAnimals::Oyster
or Oyster
and if so, what does MyAnimals::
do exactly?