I have define a method that has few class inside of it and few modules. From one of the classes I am trying to call a method that is defined in a module(inside the common one) and I get an access error. Here is the full hierachy:
module Top
class NestedClass
#some code
NestedModule::method_name
end
module NestedModule
def method_name
#some code
end
end
end
And the error that I get: undefined method 'method_name' for Top::NestedModule:Module
Write it as :
In your case you did
NestedModule::method_name
before defining the moduleNestedModule
.