Created
July 11, 2016 20:40
-
-
Save PamBWillenz/0bff9480e2c2f3e33925d05fce4b29ad to your computer and use it in GitHub Desktop.
A test of object oriented programming - for the Firehose Project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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