Skip to content

Instantly share code, notes, and snippets.

@acook
Created September 18, 2013 07:32
Show Gist options
  • Save acook/6605751 to your computer and use it in GitHub Desktop.
Save acook/6605751 to your computer and use it in GitHub Desktop.
module Stuff
def an_instance_method
puts "Stuff's instance method!"
end
def self.an_eigenclass_method
puts "Stuff's eigenclass method!"
end
module_function
def a_module_function_method
puts "Stuff's module function method!"
end
end
Stuff.an_instance_method #=> error method missing
Stuff.an_eigenclass_method
Stuff.a_module_function_method
class Something
include Stuff
end
thing = Something.new
thing.an_instance_method
thing.an_eigenclass_method #=> error method missing
thing.a_module_function_method #=> error private method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment