support/ruby/collins-state/lib/collins/state/mixin_class_methods.rb
# Convert a `Fixnum` into seconds based on the specified `time_unit`
#
# @param [Fixnum] duration Time value
# @param [Symbol] time_unit Unit of time, one of `:hour`, `:hours`, `:minute`, `:minutes`.
# @return [Fixnum] Value in seconds
Convert a `Fixnum` into seconds based on the specified `time_unit`
Convert a ` Fixnum ` into seconds based on the specified ` time_unit `
def after duration, time_unit = :seconds
      multiplier = case time_unit
                   when :days, :day
                     24*60*60
                   when :hours, :hour
                     60*60
                   when :minutes, :minute
                     60
                   else
                     1
                   end
      multiplier * duration.to_i
    end
def after duration , time_unit = :seconds multiplier = case time_unit when :days , :day 24 * 60 * 60 when :hours , :hour 60 * 60 when :minutes , :minute 60 else 1 end multiplier * duration . to_i end
Convert a `Fixnum` into seconds based on the specified `time_unit`
Convert a ` Fixnum ` into seconds based on the specified ` time_unit `
Value in seconds
Value in seconds
Fixnum
duration
time_unit
time_unit Unit of time, one of `:hour`, `:hours`, `:minute`, `:minutes`.
time_unit Unit of time one of ` : hour ` ` : hours ` ` : minute ` ` : minutes ` .