Skip to content

Instantly share code, notes, and snippets.

@therod
Created March 30, 2017 17:48
Show Gist options
  • Save therod/9100331396a689cc44a9c8f9d5eeb1c8 to your computer and use it in GitHub Desktop.
Save therod/9100331396a689cc44a9c8f9d5eeb1c8 to your computer and use it in GitHub Desktop.
class Car
attr_accessor :model, :wheels, :brand
def initialize(model, wheels, brand)
@model = model
@wheels = wheels
@brand = brand
end
def start_engine
puts "Vroooooom! #{model} lift off!"
end
def turn_on_music
puts "I kissed a girl..."
end
def turn_on_heating
puts "It's getting hot in here..."
end
def roadtrip
start_engine
turn_on_music
end
end
tesla = Car.new("S", 4, "Tesla")
tesla.roadtrip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment