Created
August 25, 2009 23:20
-
-
Save deepthawtz/175115 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
| module A | |
| # allows methods to be namespaced as A.foo, A.bar, etc... | |
| # encapsulation still works | |
| extend self | |
| def foo | |
| "This is foo calling baz: #{baz}" | |
| end | |
| def bar | |
| "This is bar" | |
| end | |
| private | |
| def baz | |
| "Hi from baz" | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment