Set each method in a module to a module-method via module_function
module MyMixin
module_function
def method_a
'A'
end
def method_b
"B"
end
end
MyMixin.method_a # => "A"
MyMixin.method_b # => "B"
Written by Gavin Morrice
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#