Skip to content

Instantly share code, notes, and snippets.

@charly
Created August 19, 2009 17:04
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/170462 to your computer and use it in GitHub Desktop.
Save charly/170462 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'mixology'
module Creme
def cost
super + 0.4
end
end
class Coffee
def cost
3
end
end
coffee = Coffee.new
coffee.mixin Creme
coffee.cost # => 3.4
# Waitress, please I asked for a black coffee
coffee.unmix Creme
coffee.cost # => 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment