Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions models/automobile.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
automobile = {}
automobile[:color] = "white"
automobile[:make] = "mini"
automobile[:year] = 1999

class Vehicle
end

Automobile = Struct.new(:automobile) do
def wheels(wheels)
puts "has #{wheels} wheels"
end
end

automobile = Automobile.new( {color: "Blue", make: "Mazda", year: 2010} )

puts "Automobile"
automobile.automobile.each do |key, value|
puts "* #{key}: #{value}"
end

puts "\nWheels"
puts "#{automobile.wheels(4)}"