I'm having a really weird problem with inheritance within a module. Here's my code:
module MyModule
class MyModule.ErrorClass < StandardError
end
end
When I run it, I get this error:
myfile.rb:2: syntax error, unexpected '<', expecting &. or :: or '[' or '.'
class MyModule.ErrorClass < StandardError
^
myfile.rb:5: syntax error, unexpected keyword_end, expecting end-of-input
However, when I change it to this:
module MyModule
class ErrorClass < StandardError
end
end
it runs fine with no errors.
MyModule::ErrorClass, that is valid ruby syntax - in your first example it's not.