Created
August 22, 2015 15:17
-
-
Save mattheweves/fcef39357beb7c1b0f26 to your computer and use it in GitHub Desktop.
Firehose Quiz 3: OOP - A Class
This file contains 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 Automobile | |
attr_accessor :year, :make, :model | |
def initialize(year, make, model) | |
self.year = year | |
self.make = make | |
self.model = model | |
end | |
def output_automobile | |
puts "#{self.year} #{self.make} #{self.model}" | |
end | |
end | |
#Example: | |
#car = Automobile.new(1991, 'Peugeot', '405') | |
#car.output_automobile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment