Class: OpenHAB::DSL::Timer
- Inherits:
-
Object
- Object
- OpenHAB::DSL::Timer
- Defined in:
- lib/rspec/openhab/dsl/timers/timer.rb
Instance Method Summary collapse
-
#cancel ⇒ Boolean
Cancel timer.
-
#initialize(duration:, thread_locals: {}, &block) ⇒ Timer
constructor
Create a new Timer Object.
-
#is_active ⇒ Object
rubocop:disable Naming/PredicateName.
- #reschedule(_duration = nil) ⇒ Object
- #terminated? ⇒ Boolean (also: #has_terminated)
Constructor Details
#initialize(duration:, thread_locals: {}, &block) ⇒ Timer
Create a new Timer Object
12 13 14 15 16 |
# File 'lib/rspec/openhab/dsl/timers/timer.rb', line 12 def initialize(duration:, thread_locals: {}, &block) # rubocop:disable Lint/UnusedMethodArgument @duration = duration Timers.timer_manager.add(self) end |
Instance Method Details
#cancel ⇒ Boolean
Cancel timer
27 28 29 |
# File 'lib/rspec/openhab/dsl/timers/timer.rb', line 27 def cancel Timers.timer_manager.delete(self) end |
#is_active ⇒ Object
rubocop:disable Naming/PredicateName
34 35 36 |
# File 'lib/rspec/openhab/dsl/timers/timer.rb', line 34 def is_active # rubocop:disable Naming/PredicateName false end |
#reschedule(_duration = nil) ⇒ Object
18 19 20 |
# File 'lib/rspec/openhab/dsl/timers/timer.rb', line 18 def reschedule(_duration = nil) Timers.timer_manager.add(self) end |
#terminated? ⇒ Boolean Also known as: has_terminated
31 |
# File 'lib/rspec/openhab/dsl/timers/timer.rb', line 31 def terminated?; end |