-
-
Save havenwood/6d91ebf489ac7739a4d10aaa79ed5b24 to your computer and use it in GitHub Desktop.
module_function example for irc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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