What is the difference between
module MyModule
module MySubModule
class MySubModuleClass
...
end
end
end
and
module MyModule
class MySubModule::MySubModuleClass
...
end
end
in Ruby?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
the second case will not work unless “MySubModule” is already defined elsewhere…
the second case is not a proper definition of “MySubModule” and will cause an error if you didn’t define that MySubModule elsewhere