Class: Co2Notify::Status::VeryHigh
- Inherits:
-
Base
- Object
- Base
- Co2Notify::Status::VeryHigh
show all
- Defined in:
- lib/co2-notify/status.rb
Instance Attribute Summary
Attributes inherited from Base
#co2, #config, #previous, #time
Instance Method Summary
collapse
Methods inherited from Base
#initialize, #type_changed?
Instance Method Details
#changed?(new_status) ⇒ Boolean
34
35
36
37
38
|
# File 'lib/co2-notify/status.rb', line 34
def changed?(new_status)
new_status.is_a?(Empty) ||
new_status.is_a?(Normal) ||
(new_status.is_a?(VeryHigh) && new_status.co2 > co2)
end
|
#color ⇒ Object
30
31
32
|
# File 'lib/co2-notify/status.rb', line 30
def color
:red
end
|
#message ⇒ Object
26
27
28
|
# File 'lib/co2-notify/status.rb', line 26
def message
"#{hc_mention}CO₂ level is very high - #{co2}. Please open the windows!"
end
|
#timeout ⇒ Object
40
41
42
|
# File 'lib/co2-notify/status.rb', line 40
def timeout
previous.is_a?(Empty) || previous.is_a?(Normal) ? cooldown : super
end
|