class Report::Item

Attributes

time[RW]

Public Class Methods

new(time) click to toggle source
# File lib/pagerduty_tools/report.rb, line 23
def initialize(time)
  @time = time
end

Public Instance Methods

between?(start_time, end_time) click to toggle source
# File lib/pagerduty_tools/report.rb, line 27
def between?(start_time, end_time)
  time >= start_time and time < end_time
end
graveyard?() click to toggle source
# File lib/pagerduty_tools/report.rb, line 36
def graveyard?
  # Worst of the worst - midnight to 8am (localtime)
  time.hour < 8
end
off_hours?() click to toggle source
# File lib/pagerduty_tools/report.rb, line 31
def off_hours?
  # Outside normal work hours - 6p to 8a (localtime)
  time.hour >= 18 or graveyard?
end