Created
December 22, 2014 01:03
-
-
Save k2works/ebbd357501c0099226f9 to your computer and use it in GitHub Desktop.
特異クラスとObject#extend
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 ExtendedModule | |
def extend_method | |
:extend_method | |
end | |
end | |
obj = Object.new | |
obj.extend ExtendedModule | |
obj.extend_method # => :extend_method |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment