Skip to content

Instantly share code, notes, and snippets.

@mattheweves
Created August 22, 2015 15:17
Show Gist options
  • Save mattheweves/fcef39357beb7c1b0f26 to your computer and use it in GitHub Desktop.
Save mattheweves/fcef39357beb7c1b0f26 to your computer and use it in GitHub Desktop.
Firehose Quiz 3: OOP - A Class
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