Created
January 16, 2013 09:24
-
-
Save rummelonp/4545813 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
# -*- coding: utf-8 -*- | |
module Nyan | |
def nyan | |
puts "いんすたんすだにゃーん" | |
end | |
class << self | |
def included(klass) | |
klass.extend(ClassMethods) | |
end | |
end | |
module ClassMethods | |
def nyan | |
puts "くらすだにゃーん" | |
end | |
end | |
end | |
class Human | |
include Nyan | |
end | |
Human.nyan | |
# => くらすだにゃーん | |
Human.new.nyan | |
# => いんすたんすだにゃーん |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment