Module: FFaker::UnitMetric
Constant Summary
collapse
- LENGTH_UNITS =
[
{ name: 'millimeters', abbreviation: 'mm' },
{ name: 'centimeters', abbreviation: 'cm' },
{ name: 'meters', abbreviation: 'm' },
{ name: 'kilometers', abbreviation: 'km' }
].freeze
- MASS_UNITS =
[
{ name: 'gram', abbreviation: 'g' },
{ name: 'kilogram', abbreviation: 'kg' },
{ name: 'metric ton', abbreviation: 'mt' }
].freeze
- LIQUID_UNITS =
[
{ name: 'milliliters', abbreviation: 'ml' },
{ name: 'liters', abbreviation: 'L' }
].freeze
- VOLUME_UNITS =
[
{ name: ' cubic centimeters', abbreviation: 'cm^3' },
{ name: 'cubic meters', abbreviation: 'm^3' }
].freeze
- AREA_UNITS =
[
{ name: 'centimeters squared', abbreviation: 'cm^2' },
{ name: 'meters squared', abbreviation: 'm^2' },
{ name: 'hectares', abbreviation: 'ha' },
{ name: 'kilometers', abbreviation: 'km' }
].freeze
Constants included
from Unit
FFaker::Unit::TEMPERATURE_UNITS, FFaker::Unit::TIME_UNITS
Instance Method Summary
collapse
const_missing, k, luhn_check, underscore, unique
#fetch_sample, #rand, #shuffle
Methods included from Unit
#temperature_abbr, #temperature_name, #time_abbr, #time_name
Instance Method Details
#area_abbr ⇒ Object
72
73
74
|
# File 'lib/ffaker/unit_metric.rb', line 72
def area_abbr
area[:abbreviation]
end
|
#area_name ⇒ Object
68
69
70
|
# File 'lib/ffaker/unit_metric.rb', line 68
def area_name
area[:name]
end
|
#length_abbr ⇒ Object
48
49
50
|
# File 'lib/ffaker/unit_metric.rb', line 48
def length_abbr
length[:abbreviation]
end
|
#length_name ⇒ Object
44
45
46
|
# File 'lib/ffaker/unit_metric.rb', line 44
def length_name
length[:name]
end
|
#liquid_abbr ⇒ Object
56
57
58
|
# File 'lib/ffaker/unit_metric.rb', line 56
def liquid_abbr
liquid[:abbreviation]
end
|
#liquid_name ⇒ Object
52
53
54
|
# File 'lib/ffaker/unit_metric.rb', line 52
def liquid_name
liquid[:name]
end
|
#mass_abbr ⇒ Object
40
41
42
|
# File 'lib/ffaker/unit_metric.rb', line 40
def mass_abbr
mass[:abbreviation]
end
|
#mass_name ⇒ Object
36
37
38
|
# File 'lib/ffaker/unit_metric.rb', line 36
def mass_name
mass[:name]
end
|
#volume_abbr ⇒ Object
64
65
66
|
# File 'lib/ffaker/unit_metric.rb', line 64
def volume_abbr
volume[:abbreviation]
end
|
#volume_name ⇒ Object
60
61
62
|
# File 'lib/ffaker/unit_metric.rb', line 60
def volume_name
volume[:name]
end
|