Skip to content

Instantly share code, notes, and snippets.

@deepthawtz
Created August 25, 2009 23:20
Show Gist options
  • Select an option

  • Save deepthawtz/175115 to your computer and use it in GitHub Desktop.

Select an option

Save deepthawtz/175115 to your computer and use it in GitHub Desktop.
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