Why NameError ??

K

Kyung won Cheon

module M1
class A
end
end

module M2
class A
end
p A # M2::A
class B
p A # M2::A
end
end

module M3
include M1
p A # M1::A
class B
p A # NameError (M3::B::A)
end
end

##############
# Help Me^^
##############
 
S

Sandro Paganotti

[Note: parts of this message were removed to make it a legal post.]

it seems that the interpreter search for a 'A' class nested inside B ... I
don't know why..
 

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

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top