Hi,
I have some trouble using module. I'm working on a rails project, but I
think it's concerning Ruby in general.
I get this kind of error 'Module is not missing constant Klass!'
I have folders looking like this :
x/y/klass.rb.
In klass my code is looking something like this :
module x
module y
class klass
end
end
end
In another file :
module x
class Anotherklass
#some method
end
end
When I use once in my methode y::klass everything works fine.
But if I use it twice, the seconde line raise the error : "x is not
missing constant klass".
I tried to load manually the file with require call but it doesn't
change anything.
It's like after the first call, ruby know that Klass is nested into y
but when I use only Klass, ruby raise that he doesn't know Klass ...
I really dunno what to do to solve this. I'm looking arround require and
include.
Thanks for reading
I have some trouble using module. I'm working on a rails project, but I
think it's concerning Ruby in general.
I get this kind of error 'Module is not missing constant Klass!'
I have folders looking like this :
x/y/klass.rb.
In klass my code is looking something like this :
module x
module y
class klass
end
end
end
In another file :
module x
class Anotherklass
#some method
end
end
When I use once in my methode y::klass everything works fine.
But if I use it twice, the seconde line raise the error : "x is not
missing constant klass".
I tried to load manually the file with require call but it doesn't
change anything.
It's like after the first call, ruby know that Klass is nested into y
but when I use only Klass, ruby raise that he doesn't know Klass ...
I really dunno what to do to solve this. I'm looking arround require and
include.
Thanks for reading