Skip to content

Instantly share code, notes, and snippets.

@naoto
Created February 25, 2013 08:06
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 naoto/5028429 to your computer and use it in GitHub Desktop.
Save naoto/5028429 to your computer and use it in GitHub Desktop.
ruby 2.0
#!/usr/bin/env ruby
class Hoge
def fuga
puts "HOGE#FUGA"
end
end
module Fuga
def fuga
puts "HOGE#FUGA#CHILD"
end
end
class Hoge
prepend Fuga
end
Hoge.new.fuga
#=> "HOGE#FUGA#CHILD"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment