zaagan
1/8/2020 - 6:50 PM

DH - Ruby Car Data Implementation

DH - Ruby Car Data Implementation

require './cars'

class Ford
    attr_reader :Name, :Origin

    def initialize(data)
        @Name = data[:Name]
        @Origin = data[:Origin]
    end
end

# Implementation
ford = Ford.new(FORD_MAVERICK_DATA)
p ford.Name  # > "ford maverick"
p ford.Origin # > "USA"