Module: FFaker::UnitMetric

Extended by:
ModuleUtils, UnitMetric
Includes:
Unit
Included in:
UnitMetric
Defined in:
lib/ffaker/unit_metric.rb

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

FFaker::Unit::TEMPERATURE_UNITS, FFaker::Unit::TIME_UNITS

Instance Method Summary collapse

Methods included from ModuleUtils

const_missing, k, underscore

Methods included from Unit

#temperature_abbr, #temperature_name, #time_abbr, #time_name

Instance Method Details

#area_abbrObject



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

def area_abbr
  area.abbreviation
end

#area_nameObject



71
72
73
# File 'lib/ffaker/unit_metric.rb', line 71

def area_name
  area.name
end

#length_abbrObject



51
52
53
# File 'lib/ffaker/unit_metric.rb', line 51

def length_abbr
  length.abbreviation
end

#length_nameObject



47
48
49
# File 'lib/ffaker/unit_metric.rb', line 47

def length_name
  length.name
end

#liquid_abbrObject



59
60
61
# File 'lib/ffaker/unit_metric.rb', line 59

def liquid_abbr
  liquid.abbreviation
end

#liquid_nameObject



55
56
57
# File 'lib/ffaker/unit_metric.rb', line 55

def liquid_name
  liquid.name
end

#mass_abbrObject



43
44
45
# File 'lib/ffaker/unit_metric.rb', line 43

def mass_abbr
  mass.abbreviation
end

#mass_nameObject



39
40
41
# File 'lib/ffaker/unit_metric.rb', line 39

def mass_name
  mass.name
end

#volume_abbrObject



67
68
69
# File 'lib/ffaker/unit_metric.rb', line 67

def volume_abbr
  volume.abbreviation
end

#volume_nameObject



63
64
65
# File 'lib/ffaker/unit_metric.rb', line 63

def volume_name
  volume.name
end