Last active
September 16, 2020 04:27
-
-
Save codetombomb/14f3478ddb4fc170a207b0f4293229f5 to your computer and use it in GitHub Desktop.
Ruby Car Factory
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 Car | |
attr_accessor :color, :year, :make, :model | |
def initialize(color, year, make, model) | |
# our instance variables are defined using a single @ | |
@color = color | |
@year = year | |
@make = make | |
@model = model | |
end | |
def get_vin | |
puts self | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment