Class: AutomateEm::Logic
- Inherits:
-
Object
- Object
- AutomateEm::Logic
- Defined in:
- lib/automate-em/logic/logic.rb
Overview
Base class for all control logic classes
Constant Summary
Constants included from Constants
Instance Attribute Summary
Attributes included from Status
Instance Method Summary collapse
- #clear_active_timers ⇒ Object
-
#initialize(system) ⇒ Logic
constructor
A new instance of Logic.
- #logger ⇒ Object
Methods included from Utilities
array_to_str, byte_to_hex, hex_to_byte, schedule, str_to_array, task
Methods included from Status
#[], #[]=, #mark_emit_end, #mark_emit_start, #update_status
Constructor Details
#initialize(system) ⇒ Logic
Returns a new instance of Logic.
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/automate-em/logic/logic.rb', line 11 def initialize(system) @system = system # # Status variables # NOTE:: if changed then change in device.rb # @status = {} @status_lock = Object.new.extend(MonitorMixin) @status_emit = {} # status => condition_variable end |
Instance Method Details
#clear_active_timers ⇒ Object
29 30 31 |
# File 'lib/automate-em/logic/logic.rb', line 29 def clear_active_timers @schedule.clear_jobs unless @schedule.nil? end |
#logger ⇒ Object
24 25 26 |
# File 'lib/automate-em/logic/logic.rb', line 24 def logger @system.logger end |