Module: FFaker::Vehicle
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
const_missing, k, luhn_check, underscore, unique
#fetch_sample, #rand, #shuffle
Instance Method Details
#base_color ⇒ Object
75
76
77
|
# File 'lib/ffaker/vehicle.rb', line 75
def base_color
FFaker::Color.name
end
|
#drivetrain ⇒ Object
79
80
81
|
# File 'lib/ffaker/vehicle.rb', line 79
def drivetrain
fetch_sample(DRIVETRAINS)
end
|
#engine_cylinders ⇒ Object
117
118
119
|
# File 'lib/ffaker/vehicle.rb', line 117
def engine_cylinders
fetch_sample(CYLINDERS)
end
|
#engine_displacement ⇒ Object
121
122
123
|
# File 'lib/ffaker/vehicle.rb', line 121
def engine_displacement
fetch_sample(DISPLACEMENTS_LIST)
end
|
#fuel_type ⇒ Object
125
126
127
|
# File 'lib/ffaker/vehicle.rb', line 125
def fuel_type
fetch_sample(FUEL_TYPES_LIST)
end
|
#interior_upholstery ⇒ Object
129
130
131
|
# File 'lib/ffaker/vehicle.rb', line 129
def interior_upholstery
fetch_sample(UPHOLSTERY_LIST)
end
|
#make ⇒ Object
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)
(fetch_sample(COLOR_PREFIXES, count: count) + [base_color]).join(' ')
end
|
#model ⇒ Object
93
94
95
|
# File 'lib/ffaker/vehicle.rb', line 93
def model
fetch_sample(MODELS_LIST)
end
|
#transmission ⇒ Object
109
110
111
|
# File 'lib/ffaker/vehicle.rb', line 109
def transmission
fetch_sample(TRANSMISSIONS_LIST)
end
|
#transmission_abbr ⇒ Object
113
114
115
|
# File 'lib/ffaker/vehicle.rb', line 113
def transmission_abbr
fetch_sample(TRANSMISSIONS_ABBR)
end
|
#trim ⇒ Object
97
98
99
|
# File 'lib/ffaker/vehicle.rb', line 97
def trim
fetch_sample(TRIMS_LIST)
end
|
#vin ⇒ Object
101
102
103
|
# File 'lib/ffaker/vehicle.rb', line 101
def vin
VIN.vin
end
|
#year ⇒ Object
105
106
107
|
# File 'lib/ffaker/vehicle.rb', line 105
def year
fetch_sample(YEARS)
end
|