Skip to content

Instantly share code, notes, and snippets.

@sonots
Created February 25, 2013 06:33
Show Gist options
  • Save sonots/5028147 to your computer and use it in GitHub Desktop.
Save sonots/5028147 to your computer and use it in GitHub Desktop.
how to write this with Module#prepend? I mean, how to call #moge2_without_hoge from #moge1_without_hoge with Module#prepend?
class Hoge < Moge
def moge1_with_hoge
moge1_without_hoge
moge2_without_hoge
end
alias_method_chain :moge1, :hoge
def moge2_with_hoge
moge2_without_hoge
end
alias_method_chain :moge2, :hoge
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment