Method: MagistrateMonitor::Supervisor#databag_for
- Defined in:
- lib/magistrate_monitor/supervisor.rb
#databag_for(worker) ⇒ Object
This method abstracts access to a worker’s databag. It guarantees to return a hash of some sort useful for referencing worker properties However, changes to this hash may not be propegated back. Quite possibly it would be better to do checking here like in set_target_state! to normalize the data?
35 36 37 |
# File 'lib/magistrate_monitor/supervisor.rb', line 35 def databag_for(worker) (self.databag['workers'].is_a?(Hash) ? self.databag['workers'][worker] : {}) || {} end |