Module: Nostradamus

Extended by:
Nostradamus
Included in:
Nostradamus
Defined in:
lib/nostradamus.rb,
lib/nostradamus/version.rb

Defined Under Namespace

Modules: Version

Constant Summary collapse

HOURS_REGEX =
/^([0-9]*):.*/
MINUTES_REGEX =
/[0-9]*:([0-9]*).*/
SECONDS_REGEX =
/[0-9]*:[0-9]*:([0-9]*)/

Instance Method Summary collapse

Instance Method Details

#humanize(seconds, format = nil) ⇒ Object



13
14
15
16
17
# File 'lib/nostradamus.rb', line 13

def humanize(seconds, format = nil)
  if seconds
    convert(seconds, :to => :human_time, :format => format)
  end
end

#parse(human_time) ⇒ Object



7
8
9
10
11
# File 'lib/nostradamus.rb', line 7

def parse(human_time)
  if human_time
    convert(human_time, :to => :seconds)
  end
end