Skip to content

Instantly share code, notes, and snippets.

@zeroeth
Forked from stopthink/gist:384741
Created April 30, 2010 17:53
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 zeroeth/385547 to your computer and use it in GitHub Desktop.
Save zeroeth/385547 to your computer and use it in GitHub Desktop.
class Bicycle
attr_reader :gears, :wheels, :seats
def intialize(gears = 1)
@wheels = 2
@seats = 1
@gears = gears
end
end
class Tandem < Bicycle
def initialize(gears)
super
@seats = 2
end
end
bike = Tandem.new(10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment