Skip to content

Instantly share code, notes, and snippets.

@charly
Created August 19, 2009 17:03
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 charly/170461 to your computer and use it in GitHub Desktop.
Save charly/170461 to your computer and use it in GitHub Desktop.
module Creme
def cost
super + 0.4
end
end
class Coffee
def cost
3
end
end
x = Coffee.new
x.extend Creme
x.cost # => 3.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment