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: 'h' },
  { name: 'Minutes', abbreviation: 'm' },
  { name: 'Seconds', abbreviation: 's' },
  { name: 'Milliseconds', abbreviation: 'ms' }
].freeze
TEMPERATURE_UNITS =
[
  { name: 'Kelvin', abbreviation: 'K' },
  { name: 'Celsius', abbreviation: 'C' },
  { name: 'Fahrenheit', abbreviation: 'F' }
].freeze

Instance Method Summary collapse

Methods included from ModuleUtils

const_missing, k, luhn_check, underscore, unique

Methods included from RandomUtils

#fetch_sample, #rand, #shuffle

Instance Method Details

#temperature_abbrObject



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

def temperature_abbr
  temperature[:abbreviation]
end

#temperature_nameObject



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

def temperature_name
  temperature[:name]
end

#time_abbrObject



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

def time_abbr
  time[:abbreviation]
end

#time_nameObject



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

def time_name
  time[:name]
end