Class: Vinbot::Vehicle

Inherits:
Object
  • Object
show all
Defined in:
lib/vinbot/vehicle.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_typeObject

Returns the value of attribute body_type.



4
5
6
# File 'lib/vinbot/vehicle.rb', line 4

def body_type
  @body_type
end

#drivetrainObject

Returns the value of attribute drivetrain.



4
5
6
# File 'lib/vinbot/vehicle.rb', line 4

def drivetrain
  @drivetrain
end

#engine_typeObject

Returns the value of attribute engine_type.



4
5
6
# File 'lib/vinbot/vehicle.rb', line 4

def engine_type
  @engine_type
end

#exterior_colorsObject

Returns the value of attribute exterior_colors.



4
5
6
# File 'lib/vinbot/vehicle.rb', line 4

def exterior_colors
  @exterior_colors
end

#interior_colorsObject

Returns the value of attribute interior_colors.



4
5
6
# File 'lib/vinbot/vehicle.rb', line 4

def interior_colors
  @interior_colors
end

#makeObject

Returns the value of attribute make.



4
5
6
# File 'lib/vinbot/vehicle.rb', line 4

def make
  @make
end

#modelObject

Returns the value of attribute model.



4
5
6
# File 'lib/vinbot/vehicle.rb', line 4

def model
  @model
end

#transmissionObject

Returns the value of attribute transmission.



4
5
6
# File 'lib/vinbot/vehicle.rb', line 4

def transmission
  @transmission
end

#trimObject

Returns the value of attribute trim.



4
5
6
# File 'lib/vinbot/vehicle.rb', line 4

def trim
  @trim
end

#vehicle_typeObject

Returns the value of attribute vehicle_type.



4
5
6
# File 'lib/vinbot/vehicle.rb', line 4

def vehicle_type
  @vehicle_type
end

#vinObject

Returns the value of attribute vin.



4
5
6
# File 'lib/vinbot/vehicle.rb', line 4

def vin
  @vin
end

#yearObject

Returns the value of attribute year.



4
5
6
# File 'lib/vinbot/vehicle.rb', line 4

def year
  @year
end