Module: AutomateEm::ModuleCore
- Defined in:
- lib/automate-em/device/device.rb
Constant Summary
Constants included from Constants
Instance Attribute Summary collapse
-
#base ⇒ Object
readonly
Returns the value of attribute base.
-
#systems ⇒ Object
readonly
Returns the value of attribute systems.
Attributes included from Status
Instance Method Summary collapse
- #clear_active_timers ⇒ Object
- #join_system(system) ⇒ Object
- #leave_system(system) ⇒ Object
- #logger ⇒ Object
-
#setbase(base) ⇒ Object
Sets up a link for the user code to the eventmachine class This way the namespace is clean.
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
Instance Attribute Details
#base ⇒ Object (readonly)
Returns the value of attribute base.
47 48 49 |
# File 'lib/automate-em/device/device.rb', line 47 def base @base end |
#systems ⇒ Object (readonly)
Returns the value of attribute systems.
46 47 48 |
# File 'lib/automate-em/device/device.rb', line 46 def systems @systems end |
Instance Method Details
#clear_active_timers ⇒ Object
29 30 31 |
# File 'lib/automate-em/device/device.rb', line 29 def clear_active_timers @schedule.clear_jobs unless @schedule.nil? end |
#join_system(system) ⇒ Object
16 17 18 19 20 |
# File 'lib/automate-em/device/device.rb', line 16 def join_system(system) @system_lock.synchronize { @systems << system } end |
#leave_system(system) ⇒ Object
22 23 24 25 26 27 |
# File 'lib/automate-em/device/device.rb', line 22 def leave_system(system) @system_lock.synchronize { @systems.delete(system) return @systems.length } end |
#logger ⇒ Object
39 40 41 42 43 44 |
# File 'lib/automate-em/device/device.rb', line 39 def logger @system_lock.synchronize { return @systems[0].logger unless @systems.empty? } System.logger end |
#setbase(base) ⇒ Object
Sets up a link for the user code to the eventmachine class This way the namespace is clean.
11 12 13 |
# File 'lib/automate-em/device/device.rb', line 11 def setbase(base) @base = base end |