Skip to content

Instantly share code, notes, and snippets.

@apeiros
Forked from mlangenberg/car.rb
Created August 28, 2008 08: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 apeiros/7673 to your computer and use it in GitHub Desktop.
Save apeiros/7673 to your computer and use it in GitHub Desktop.
module Lib
def has_color
define_method(:color) do 'red' end
end
end
class Car
extend Lib
has_color
end
c = Car.new
c.color
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment