Module: FFaker::Unit

Extended by:
ModuleUtils, Unit
Included in:
Unit, UnitEnglish, UnitMetric
Defined in:
lib/ffaker/unit.rb

Constant Summary collapse

TIME_UNITS =
[
  { name: 'Years', abbreviation: 'yr' },
  { name: 'Days', abbreviation: 'd' },
  { name: 'Hours', abbreviation: 'Minutes' },
  { name: 'Seconds', abbreviation: 's' },
  { name: 'Milliseconds', abbreviation: 'msec' }
]
TEMPERATURE_UNITS =
[
  { name: 'Kelvin', abbreviation: 'K' },
  { name: 'Celsius', abbreviation: 'C' },
  { name: 'Fahrenheit', abbreviation: 'F' }
]

Instance Method Summary collapse

Methods included from ModuleUtils

const_missing, k, underscore

Instance Method Details

#temperature_abbrObject



35
36
37
# File 'lib/ffaker/unit.rb', line 35

def temperature_abbr
  temperature.abbreviation
end

#temperature_nameObject



31
32
33
# File 'lib/ffaker/unit.rb', line 31

def temperature_name
  temperature.name
end

#time_abbrObject



27
28
29
# File 'lib/ffaker/unit.rb', line 27

def time_abbr
  time.abbreviation
end

#time_nameObject



23
24
25
# File 'lib/ffaker/unit.rb', line 23

def time_name
  time.name
end