class TimeSpanner::TimeUnits::Day

Public Class Methods

new() click to toggle source
# File lib/time_spanner/time_units/day.rb, line 6
def initialize
  super 7
end

Private Instance Methods

at_amount(amount) click to toggle source
# File lib/time_spanner/time_units/day.rb, line 18
def at_amount amount
  ( from.to_datetime + amount ).to_time
end
calculate_amount() click to toggle source
# File lib/time_spanner/time_units/day.rb, line 13
def calculate_amount
  amount  = ( to.to_time - from.to_time ).to_i / 86400
  @amount = at_amount( amount ) > to ? amount - 1 : amount
end