Skip to content

Instantly share code, notes, and snippets.

@leandro
Created December 20, 2009 17:52
Show Gist options
  • Select an option

  • Save leandro/260574 to your computer and use it in GitHub Desktop.

Select an option

Save leandro/260574 to your computer and use it in GitHub Desktop.
# basic example on how to create module methods not accessible for classes are including it
module Foo
class << self
def show_me
puts 'Foo'
end
end
end
Foo::show_me # => 'Foo'
class FooBar
include Foo
end
FooBar.new.show_me # will throw NoMethodError
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment