Under Ruby 2.0, what is the correct way to access a module method from a class in that module?
For instance, if I have
module Foo
class Foo
def do_something
Foo::module_method
end
end
def self.module_method
puts 'How do I call this?'
end
end
I get,
./so-module.rb:7:in
do_something': undefined method
module_method' for Foo::Foo:Class (NoMethodError) from ./so-module.rb:16:in `'
What is the correct way to define the module method so I can access it from class Foo
?