Calling my framework

I’m developing a framework but I would like to call the classes as I was
in Java.
An example:
requiere ‘myAclasses’
requiere ‘myBclasses’

The problem is that I don’t know where are these classes and I would
like to call them something like this:

Is this possible???
How can I do it?

Thans in advance.

On Nov 22, 2007 2:12 PM, Mario R. [email protected] wrote:

Is this possible???
How can I do it?

Note that true class names has to start with an uppercase letter; I’ve
compensated for that below.

First, you can do module wrapping (namespacing):

module MyAclasses
class Myclass22

and call as

Second, you could do this using a method that returns a class object.

In other words, something like

class MyAClassContainer
def myclass22
return MyClass22
myAclasses = # (or any other factory method)
mya =

The latter technique can be useful if your hierarchy and what you want
to produce change at runtime. It seems like very many levels of
indirection, though, so I would think carefully of whether it is
necessary. (Each level of indirection tends to make things harder to
grasp/think about/debug.)


The first seems to be the solution to my problem, I didn’t realize
Even you can add more modules:
module Mod1
module Mod2
class Clas1
end Class

That’s great!!!

Thank you very much.