Module: L43::Time::Parser::Helper

Extended by:
Helper
Included in:
Helper
Defined in:
lib/l43/time/parser.rb

Constant Summary collapse

Units =
{
  's' => [1, 'seconds'],
  'second' => [1, 'seconds'],
  'seconds' => [1, 'seconds'],

  'm' => [60, 'minutes'],
  'minute' => [60, 'minutes'],
  'minutes' => [60, 'minutes'],

  'h' => [3600, 'hours'],
  'hour' => [3600, 'hours'],
  'hours' => [3600, 'hours'],

  'd' => [86400, 'days'],
  'day' => [86400, 'days'],
  'days' => [86400, 'days'],
}

Instance Method Summary collapse

Instance Method Details

#parse_prefix(str) ⇒ Object



86
# File 'lib/l43/time/parser.rb', line 86

def parse_prefix(str) = _parse_with(str, rgx: Prefix)

#parse_suffix(str) ⇒ Object



87
# File 'lib/l43/time/parser.rb', line 87

def parse_suffix(str) = _parse_with(str, rgx: Suffix)