Class: HealthCheckToolbox::StatusManager
- Inherits:
-
Object
- Object
- HealthCheckToolbox::StatusManager
- Defined in:
- lib/health_check_toolbox/status_manager.rb
Instance Attribute Summary collapse
-
#services ⇒ Object
readonly
Returns the value of attribute services.
Class Method Summary collapse
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(services) ⇒ StatusManager
constructor
A new instance of StatusManager.
Constructor Details
#initialize(services) ⇒ StatusManager
Returns a new instance of StatusManager.
11 12 13 |
# File 'lib/health_check_toolbox/status_manager.rb', line 11 def initialize(services) @services = services end |
Instance Attribute Details
#services ⇒ Object (readonly)
Returns the value of attribute services.
5 6 7 |
# File 'lib/health_check_toolbox/status_manager.rb', line 5 def services @services end |
Class Method Details
.generate(services) ⇒ Object
7 8 9 |
# File 'lib/health_check_toolbox/status_manager.rb', line 7 def self.generate(services) new(services).generate end |
Instance Method Details
#generate ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/health_check_toolbox/status_manager.rb', line 15 def generate statuses = {} services.each.with_index(1) do |service, index| status_index = "status_#{index}".to_sym if service.respond_to?(:services) services_block(service, index, statuses) else statuses[status_index] = status(service) end end statuses end |