module SimplePeriod

Constants

DAY_SEC
HOUR_SEC
MIN_SEC
MONTH_SEC
VERSION
WEEK_SEC
YEAR_SEC

Public Class Methods

second(period) click to toggle source
# File lib/simple_period.rb, line 13
def second(period)
  case period
  when Format.min_proc
    period.to_i * MIN_SEC
  when Format.hour_proc
    period.to_i * HOUR_SEC
  when Format.day_proc
    period.to_i * DAY_SEC
  when Format.week_proc
    period.to_i * WEEK_SEC
  when Format.month_proc
    period.to_i * MONTH_SEC
  when Format.year_proc
    period.to_i * YEAR_SEC
  else
    period
  end
end