B
Brian Schroeder
Hello Group,
I think that ruby is a bit too intelligent regarding module names.
Consider the follwing situation
module B
class B; end
end
module A
module B
module C
class C < B::B; end
end
end
end
This does not work, as ruby tries to load A::B::B instead of B::B as
I supposed. So for example I can't create a class structure
module MyProg
module UI
module Gnome
class Something < Gnome::Canvas
end
end
end
even though this would seem a natural naming scheme to me.
What is the reason behind this behaviour, and is it possible to avoid
this problem without renaming my module to MyProg::UI::GnomeUI which
seems redundant to me?
regards,
Brian Schröder
I think that ruby is a bit too intelligent regarding module names.
Consider the follwing situation
module B
class B; end
end
module A
module B
module C
class C < B::B; end
end
end
end
This does not work, as ruby tries to load A::B::B instead of B::B as
I supposed. So for example I can't create a class structure
module MyProg
module UI
module Gnome
class Something < Gnome::Canvas
end
end
end
even though this would seem a natural naming scheme to me.
What is the reason behind this behaviour, and is it possible to avoid
this problem without renaming my module to MyProg::UI::GnomeUI which
seems redundant to me?
regards,
Brian Schröder