[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Class - Module, Name collision

Vladare

1/13/2006 5:52:00 PM

Hi All,

I am going to use in my project two another's libraries. First of one
already defined a class with a name "Foo" and another one defined a
module with a name "Foo" too.
As a result I have this

irb(main):001:0> require "1"
=> true
irb(main):002:0> require "2"
TypeError: Foo is not a class
from ./2.rb:1
from (irb):2
irb(main):003:0>

or conversely,

irb(main):001:0> require "2"
=> true
irb(main):002:0> require "1"
TypeError: Foo is not a module
from ./1.rb:1
from (irb):2
irb(main):003:0>

How I can use both of this libraries without changing theirs code?

Thank you,
Vladare