Created
March 20, 2013 19:09
-
-
Save kezek/5207525 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#this is singleton pattern | |
module MyModule | |
self.method1 | |
'method1' | |
end | |
self.method2 | |
'method2' | |
end | |
self.method3 | |
'method3' | |
end | |
end | |
# I want to autoload this module in Rails 3 | |
# so that I can call these methods anywhere in | |
# my models | |
# i.e. MyModule.method1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment