Skip to content

Instantly share code, notes, and snippets.

@codetombomb
Last active September 16, 2020 04:27
Show Gist options
  • Save codetombomb/14f3478ddb4fc170a207b0f4293229f5 to your computer and use it in GitHub Desktop.
Save codetombomb/14f3478ddb4fc170a207b0f4293229f5 to your computer and use it in GitHub Desktop.
Ruby Car Factory
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