Created
March 30, 2017 17:48
-
-
Save therod/9100331396a689cc44a9c8f9d5eeb1c8 to your computer and use it in GitHub Desktop.
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 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