Created
June 14, 2010 21:40
-
-
Save brianc/438347 to your computer and use it in GitHub Desktop.
This file contains 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 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