Skip to content

Instantly share code, notes, and snippets.

@brianc
Created June 14, 2010 21:40
Show Gist options
  • Save brianc/438347 to your computer and use it in GitHub Desktop.
Save brianc/438347 to your computer and use it in GitHub Desktop.
module Awesomeness
def hello
puts "hello"
end
def self.included(klass)
klass.class_eval { include Awesomeness::ClassMethods }
end
module ClassMethods
def hello
puts "YAY"
end
end
end
class Person
include Awesomeness
end
Person.hello => "YAY"
Person.new.hello => "hello"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment