Skip to content

Instantly share code, notes, and snippets.

@PamBWillenz
Created July 11, 2016 20:40
Show Gist options
  • Save PamBWillenz/0bff9480e2c2f3e33925d05fce4b29ad to your computer and use it in GitHub Desktop.
Save PamBWillenz/0bff9480e2c2f3e33925d05fce4b29ad to your computer and use it in GitHub Desktop.
A test of object oriented programming - for the Firehose Project
class Bike
attr_accessor :type, :model
def initialize(type, model)
@type = type
@model = model
end
def tour_bike
puts "A #{@type} #{@model} is one of the tour bikes this year."
end
end
bike = Bike.new('specialize', 'roubaix')
puts bike
puts bike.type
puts bike.model
bike.model = 'tarmac'
puts bike.model
bike.tour_bike
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment