Class: Co2Notify::Notifier
- Inherits:
-
Object
- Object
- Co2Notify::Notifier
- Defined in:
- lib/co2-notify/notifier.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(config) ⇒ Notifier
constructor
A new instance of Notifier.
- #start ⇒ Object
Constructor Details
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
6 7 8 |
# File 'lib/co2-notify/notifier.rb', line 6 def client @client end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
6 7 8 |
# File 'lib/co2-notify/notifier.rb', line 6 def config @config end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
6 7 8 |
# File 'lib/co2-notify/notifier.rb', line 6 def status @status end |
Class Method Details
Instance Method Details
#start ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/co2-notify/notifier.rb', line 15 def start loop do time = Time.now if time > start_time && time < stop_time notify end sleep timeout * 60 end rescue Interrupt end |