Skip to content

Instantly share code, notes, and snippets.

@havenwood
Created August 10, 2019 15:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save havenwood/6d91ebf489ac7739a4d10aaa79ed5b24 to your computer and use it in GitHub Desktop.
Save havenwood/6d91ebf489ac7739a4d10aaa79ed5b24 to your computer and use it in GitHub Desktop.
module_function example for irc
module Example
module_function
def another_method
42
end
end
# This can be called directly, like it's `self.another_method`.
Example.another_method
#=> 42
# Or mixed in, but it will be private when included or prepended.
include Example
another_method
#=> 42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment