Class: Time

Inherits:
Object
  • Object
show all
Defined in:
lib/time_clock/core_ext/time.rb

Instance Method Summary collapse

Instance Method Details

#business_hours_until(time) ⇒ Object



11
12
13
# File 'lib/time_clock/core_ext/time.rb', line 11

def business_hours_until(time)
  (business_seconds_until(time).to_f / 3600).ceil
end

#business_minutes_until(time) ⇒ Object



7
8
9
# File 'lib/time_clock/core_ext/time.rb', line 7

def business_minutes_until(time)
  (business_seconds_until(time).to_f / 60).ceil
end

#business_seconds_until(time) ⇒ Object



3
4
5
# File 'lib/time_clock/core_ext/time.rb', line 3

def business_seconds_until(time)
  TimeClock::Comparison.new(self, time).seconds.to_i
end