Module: FFaker::Vehicle

Extended by:
ModuleUtils, Vehicle
Included in:
Vehicle
Defined in:
lib/ffaker/vehicle.rb

Defined Under Namespace

Modules: VIN

Constant Summary collapse

DRIVETRAINS =
%w[4WD 4X4 AWD FWD RWD].freeze
YEARS =
Array('1900'..(::Time.now.year + 1).to_s).freeze
TRANSMISSIONS_ABBR =
%w[AT MT AM CVT].freeze
CYLINDERS =
%w[2 5 6 8].freeze

Instance Method Summary collapse

Methods included from ModuleUtils

const_missing, k, luhn_check, underscore, unique

Methods included from RandomUtils

#fetch_sample, #rand, #shuffle

Instance Method Details

#base_colorObject



75
76
77
# File 'lib/ffaker/vehicle.rb', line 75

def base_color
  FFaker::Color.name
end

#drivetrainObject



79
80
81
# File 'lib/ffaker/vehicle.rb', line 79

def drivetrain
  fetch_sample(DRIVETRAINS)
end

#engine_cylindersObject



117
118
119
# File 'lib/ffaker/vehicle.rb', line 117

def engine_cylinders
  fetch_sample(CYLINDERS)
end

#engine_displacementObject



121
122
123
# File 'lib/ffaker/vehicle.rb', line 121

def engine_displacement
  fetch_sample(DISPLACEMENTS_LIST)
end

#fuel_typeObject



125
126
127
# File 'lib/ffaker/vehicle.rb', line 125

def fuel_type
  fetch_sample(FUEL_TYPES_LIST)
end

#interior_upholsteryObject



129
130
131
# File 'lib/ffaker/vehicle.rb', line 129

def interior_upholstery
  fetch_sample(UPHOLSTERY_LIST)
end

#makeObject



83
84
85
# File 'lib/ffaker/vehicle.rb', line 83

def make
  fetch_sample(MAKES_LIST)
end

#manufacturer_color(count = 2) ⇒ Object Also known as: mfg_color



87
88
89
90
# File 'lib/ffaker/vehicle.rb', line 87

def manufacturer_color(count = 2)
  # Take two prefixes because it's more fun than one
  (fetch_sample(COLOR_PREFIXES, count: count) + [base_color]).join(' ')
end

#modelObject



93
94
95
# File 'lib/ffaker/vehicle.rb', line 93

def model
  fetch_sample(MODELS_LIST)
end

#transmissionObject



109
110
111
# File 'lib/ffaker/vehicle.rb', line 109

def transmission
  fetch_sample(TRANSMISSIONS_LIST)
end

#transmission_abbrObject



113
114
115
# File 'lib/ffaker/vehicle.rb', line 113

def transmission_abbr
  fetch_sample(TRANSMISSIONS_ABBR)
end

#trimObject



97
98
99
# File 'lib/ffaker/vehicle.rb', line 97

def trim
  fetch_sample(TRIMS_LIST)
end

#vinObject



101
102
103
# File 'lib/ffaker/vehicle.rb', line 101

def vin
  VIN.vin
end

#yearObject



105
106
107
# File 'lib/ffaker/vehicle.rb', line 105

def year
  fetch_sample(YEARS)
end