DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Inheriting Class And Instance Methods From Module To Class In Ruby
Here you can see how to define both instance and class method in a module in order to mix them into a class
module MyModule
def my_instance_method
...
end
def self.included klass
def klass.my_class_method
...
end
end
end
And usage:
class MyClass
include MyModule
my_class_method
...
def method_that_uses_the_module
my_instance_method
...
end
end





