Sha256: 78bcb93b992064b43497feba9c70ac4c4c7c96895d8aaa26cb5d57a429413d8e
Contents?: true
Size: 953 Bytes
Versions: 9
Compression:
Stored size: 953 Bytes
Contents
# frozen_string_literal: true module FFakerTW module Unit extend ModuleUtils extend self 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 def time_name time[:name] end def time_abbr time[:abbreviation] end def temperature_name temperature[:name] end def temperature_abbr temperature[:abbreviation] end private def time fetch_sample(TIME_UNITS) end def temperature fetch_sample(TEMPERATURE_UNITS) end end end
Version data entries
9 entries across 9 versions & 1 rubygems