Skip to content

Instantly share code, notes, and snippets.

@ty-shaikh
Created June 9, 2016 19:54
Show Gist options
  • Save ty-shaikh/88b3dbca21effcf6d604a1d236a6fe56 to your computer and use it in GitHub Desktop.
Save ty-shaikh/88b3dbca21effcf6d604a1d236a6fe56 to your computer and use it in GitHub Desktop.
OOP Practice
class Car
attr_accessor :brand, :model
def initialize(brand, model)
@brand = brand
@model = model
end
def name
puts "#{self.brand} #{self.model}"
end
end
car = Car.new("Toyota", "Camry")
car.name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment