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, underscore
#fetch_sample, #rand, #shuffle
Methods included from Unit
#temperature_abbr, #temperature_name, #time_abbr, #time_name
Instance Method Details
#area_abbr ⇒ Object
75
76
77
|
# File 'lib/ffaker/unit_metric.rb', line 75
def area_abbr
area.abbreviation
end
|
#area_name ⇒ Object
71
72
73
|
# File 'lib/ffaker/unit_metric.rb', line 71
def area_name
area.name
end
|
#length_abbr ⇒ Object
51
52
53
|
# File 'lib/ffaker/unit_metric.rb', line 51
def length_abbr
length.abbreviation
end
|
#length_name ⇒ Object
47
48
49
|
# File 'lib/ffaker/unit_metric.rb', line 47
def length_name
length.name
end
|
#liquid_abbr ⇒ Object
59
60
61
|
# File 'lib/ffaker/unit_metric.rb', line 59
def liquid_abbr
liquid.abbreviation
end
|
#liquid_name ⇒ Object
55
56
57
|
# File 'lib/ffaker/unit_metric.rb', line 55
def liquid_name
liquid.name
end
|
#mass_abbr ⇒ Object
43
44
45
|
# File 'lib/ffaker/unit_metric.rb', line 43
def mass_abbr
mass.abbreviation
end
|
#mass_name ⇒ Object
39
40
41
|
# File 'lib/ffaker/unit_metric.rb', line 39
def mass_name
mass.name
end
|
#volume_abbr ⇒ Object
67
68
69
|
# File 'lib/ffaker/unit_metric.rb', line 67
def volume_abbr
volume.abbreviation
end
|
#volume_name ⇒ Object
63
64
65
|
# File 'lib/ffaker/unit_metric.rb', line 63
def volume_name
volume.name
end
|