Skip to content

Instantly share code, notes, and snippets.

@alxjrvs
Created September 3, 2015 17:13
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 alxjrvs/cd5abdcefede7d4acaca to your computer and use it in GitHub Desktop.
Save alxjrvs/cd5abdcefede7d4acaca to your computer and use it in GitHub Desktop.
require 'pry'
module Driveable
def go
"Vroom Vroom!"
end
def stop
"Sad."
end
def self.included(base)
base.extend(HasWheels)
end
module HasWheels
def has_wheels?
true
end
end
end
class Car
include Driveable
end
class Bus
include Driveable
end
class Boat
include Driveable
def go
"hrrbrlblblblblblblblblblblblblb"
end
end
class Truck < Car
def go
super + " VRRRRRRRROOOOOOOMMM"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment