Skip to content

Instantly share code, notes, and snippets.

@floere
Created September 7, 2011 12:08
Show Gist options
  • Select an option

  • Save floere/1200402 to your computer and use it in GitHub Desktop.

Select an option

Save floere/1200402 to your computer and use it in GitHub Desktop.
Decoration using extend
module Decoration
def something
p :in_decoration_calling_super
super
p :after_super
end
end
class Thing
def something
p :in_thing
end
end
thing = Thing.new.extend Decoration
thing.something # =>
# :in_decoration_calling_super
# :in_thing
# :after_super
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment