Skip to content

Instantly share code, notes, and snippets.

@maehrm
Created February 27, 2011 06:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maehrm/845949 to your computer and use it in GitHub Desktop.
Save maehrm/845949 to your computer and use it in GitHub Desktop.
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