Class - Module, Name collision

V

vladare

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Class instance method 2
Adding to the Errno module 1
class context 1
parentheses and newlines 2
confused about the superclass 3
convert date 5
require command problem 4
Set class and repetetive elements 6

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top