Module: AutomateEm::ModuleCore
- Defined in:
- lib/automate-em/module_core.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, #update_status
Instance Attribute Details
#base ⇒ Object (readonly)
Returns the value of attribute base.
50 51 52 |
# File 'lib/automate-em/module_core.rb', line 50 def base @base end |
#systems ⇒ Object (readonly)
Returns the value of attribute systems.
49 50 51 |
# File 'lib/automate-em/module_core.rb', line 49 def systems @systems end |
Instance Method Details
#clear_active_timers ⇒ Object
32 33 34 |
# File 'lib/automate-em/module_core.rb', line 32 def clear_active_timers @schedule.clear_jobs unless @schedule.nil? end |
#join_system(system) ⇒ Object
19 20 21 22 23 |
# File 'lib/automate-em/module_core.rb', line 19 def join_system(system) @system_lock.synchronize { @systems << system } end |
#leave_system(system) ⇒ Object
25 26 27 28 29 30 |
# File 'lib/automate-em/module_core.rb', line 25 def leave_system(system) @system_lock.synchronize { @systems.delete(system) return @systems.length } end |
#logger ⇒ Object
42 43 44 45 46 47 |
# File 'lib/automate-em/module_core.rb', line 42 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 14 15 16 |
# File 'lib/automate-em/module_core.rb', line 11 def setbase(base) @base = base class << self undef setbase end end |