Class: SinatraHealthCheck::Status::StrictAggregator
- Inherits:
-
Object
- Object
- SinatraHealthCheck::Status::StrictAggregator
- Defined in:
- lib/sinatra-health-check/status/strict_aggregator.rb
Overview
Aggregate sub statuus, worst wins
Instance Method Summary collapse
Instance Method Details
#aggregate(statuus) ⇒ Object
3 4 5 6 7 8 |
# File 'lib/sinatra-health-check/status/strict_aggregator.rb', line 3 def aggregate(statuus) status = statuus.values.max_by { |s| s.to_i } || SinatraHealthCheck::Status.new(:ok, 'everything is fine') = status.level == :ok ? 'everything is fine' : "at least one status is #{status.level}" SinatraHealthCheck::Status::Aggregated.new(status.level, , statuus) end |