I have the following Ruby code:
module MyModule
class MyClass
def self.my_method
end
end
end
To call my_method, I enter MyModule::MyClass.my_method. I’d like to write a wrapper for my_method on the module itself:
MyModule.my_method
Is this possible?
Simple method:
Harder method:
Use metaprogramming to write a function for all cases (like attr_accessor).