Method: MagistrateMonitor::Supervisor#normalize_status_data!
- Defined in:
- lib/magistrate_monitor/supervisor.rb
#normalize_status_data! ⇒ Object
This makes sure that: All supervisors have a status that is a hash If it has something else for whatever reason, the real object is put in a hash under the ‘status’ key
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/magistrate_monitor/supervisor.rb', line 11 def normalize_status_data! self.status ||= {} self.status['workers'] ||= {} self.status['workers'].each do |k,v| unless v.is_a?(Hash) v = {'state' => v.inspect } end end self.databag ||= {} self.databag['workers'] ||= {} end |