Class: Vinbot::Vehicle
- Inherits:
-
Object
- Object
- Vinbot::Vehicle
- Defined in:
- lib/vinbot/vehicle.rb
Instance Attribute Summary collapse
-
#body_type ⇒ Object
Returns the value of attribute body_type.
-
#drivetrain ⇒ Object
Returns the value of attribute drivetrain.
-
#engine_type ⇒ Object
Returns the value of attribute engine_type.
-
#exterior_colors ⇒ Object
Returns the value of attribute exterior_colors.
-
#interior_colors ⇒ Object
Returns the value of attribute interior_colors.
-
#make ⇒ Object
Returns the value of attribute make.
-
#model ⇒ Object
Returns the value of attribute model.
-
#transmission ⇒ Object
Returns the value of attribute transmission.
-
#trim ⇒ Object
Returns the value of attribute trim.
-
#vehicle_type ⇒ Object
Returns the value of attribute vehicle_type.
-
#vin ⇒ Object
Returns the value of attribute vin.
-
#year ⇒ Object
Returns the value of attribute year.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Vehicle
constructor
A new instance of Vehicle.
Constructor Details
#initialize(params = {}) ⇒ Vehicle
Returns a new instance of Vehicle.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/vinbot/vehicle.rb', line 7 def initialize(params = {}) vehicle = ::Vinbot::Data::Vehicle.get_vehicle(params) @year = vehicle.year.name @make = vehicle.make.name @model = vehicle.model.name @trim = vehicle.trim.name @engine_type = vehicle.engine_type.name @transmission = vehicle.transmission.name @body_type = vehicle.body_type.name @vehicle_type = vehicle.vehicle_type.name @drivetrain = vehicle.drivetrain.name @interior_colors = vehicle.interior_color.name.split(',') @exterior_colors = vehicle.exterior_color.name.split(',') @vin = Vin.generate_from_partial_vin(vehicle.partial_vin) end |
Instance Attribute Details
#body_type ⇒ Object
Returns the value of attribute body_type.
4 5 6 |
# File 'lib/vinbot/vehicle.rb', line 4 def body_type @body_type end |
#drivetrain ⇒ Object
Returns the value of attribute drivetrain.
4 5 6 |
# File 'lib/vinbot/vehicle.rb', line 4 def drivetrain @drivetrain end |
#engine_type ⇒ Object
Returns the value of attribute engine_type.
4 5 6 |
# File 'lib/vinbot/vehicle.rb', line 4 def engine_type @engine_type end |
#exterior_colors ⇒ Object
Returns the value of attribute exterior_colors.
4 5 6 |
# File 'lib/vinbot/vehicle.rb', line 4 def exterior_colors @exterior_colors end |
#interior_colors ⇒ Object
Returns the value of attribute interior_colors.
4 5 6 |
# File 'lib/vinbot/vehicle.rb', line 4 def interior_colors @interior_colors end |
#make ⇒ Object
Returns the value of attribute make.
4 5 6 |
# File 'lib/vinbot/vehicle.rb', line 4 def make @make end |
#model ⇒ Object
Returns the value of attribute model.
4 5 6 |
# File 'lib/vinbot/vehicle.rb', line 4 def model @model end |
#transmission ⇒ Object
Returns the value of attribute transmission.
4 5 6 |
# File 'lib/vinbot/vehicle.rb', line 4 def transmission @transmission end |
#trim ⇒ Object
Returns the value of attribute trim.
4 5 6 |
# File 'lib/vinbot/vehicle.rb', line 4 def trim @trim end |
#vehicle_type ⇒ Object
Returns the value of attribute vehicle_type.
4 5 6 |
# File 'lib/vinbot/vehicle.rb', line 4 def vehicle_type @vehicle_type end |
#vin ⇒ Object
Returns the value of attribute vin.
4 5 6 |
# File 'lib/vinbot/vehicle.rb', line 4 def vin @vin end |
#year ⇒ Object
Returns the value of attribute year.
4 5 6 |
# File 'lib/vinbot/vehicle.rb', line 4 def year @year end |