Created
February 27, 2011 06:01
-
-
Save maehrm/845949 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
obj = Object.new | |
module Hoge | |
def one | |
"one" | |
end | |
def two | |
"two" | |
end | |
end | |
# (1) | |
# class << obj | |
# include Hoge | |
# end | |
# (2) | |
obj.extend Hoge | |
p obj.one |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment