Class: Report::Item
- Inherits:
-
Object
show all
- Defined in:
- lib/pagerduty_tools/report.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(time) ⇒ Item
Returns a new instance of Item.
23
24
25
|
# File 'lib/pagerduty_tools/report.rb', line 23
def initialize(time)
@time = time
end
|
Instance Attribute Details
#time ⇒ Object
Returns the value of attribute time.
21
22
23
|
# File 'lib/pagerduty_tools/report.rb', line 21
def time
@time
end
|
Instance Method Details
#between?(start_time, end_time) ⇒ Boolean
27
28
29
|
# File 'lib/pagerduty_tools/report.rb', line 27
def between?(start_time, end_time)
time >= start_time and time < end_time
end
|
#graveyard? ⇒ Boolean
36
37
38
39
|
# File 'lib/pagerduty_tools/report.rb', line 36
def graveyard?
time.hour < 8
end
|
#off_hours? ⇒ Boolean
31
32
33
34
|
# File 'lib/pagerduty_tools/report.rb', line 31
def off_hours?
time.hour >= 18 or graveyard?
end
|