Skip to content

Instantly share code, notes, and snippets.

@codetombomb
Last active September 16, 2020 04:42
Show Gist options
  • Save codetombomb/4f068070e939c57ecf977c7fc291dfbc to your computer and use it in GitHub Desktop.
Save codetombomb/4f068070e939c57ecf977c7fc291dfbc to your computer and use it in GitHub Desktop.
Another Example for instance of self
class Car
attr_accessor :color, :year, :make, :model
def initialize(color, year, make, model)
@color = color
@year = year
@make = make
@model = model
end
def get_vin
puts self
end
def years_old
Time.now.year - self.year
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment