Module: Faker::UnitMetric
Constant Summary
collapse
- LENGTH_UNITS =
[
{ name: "millimeters", abbreviation: "mm"},
{ name: "centimeters", abbreviation: "cm"},
{ name: "meters", abbreviation: "m"},
{ name: "kilometers", abbreviation: "km"}
]
- MASS_UNITS =
[
{ name: "gram", abbreviation: "g"},
{ name: "kilogram", abbreviation: "kg" },
{ name: "metric ton", abbreviation: "mt"}
]
- LIQUID_UNITS =
[
{ name: "milliliters", abbreviation: "ml"},
{ name: "liters", abbreviation: "L"}
]
- VOLUME_UNITS =
[
{ name: " cubic centimeters", abbreviation: "cm^3"},
{ name: "cubic meters", abbreviation: "m^3"}
]
- AREA_UNITS =
[
{ name: "centimeters squared", abbreviation: "cm^2"},
{ name: "meters squared", abbreviation: "m^2"},
{ name: "hectares", abbreviation: "ha"},
{ name: "kilometers", abbreviation: "km" }
]
Constants included
from Unit
Faker::Unit::TEMPERATURE_UNITS, Faker::Unit::TIME_UNITS
Instance Method Summary
collapse
const_missing, k, underscore
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
|