Class: LogBrew::DeliveryHealth
- Inherits:
-
Object
- Object
- LogBrew::DeliveryHealth
- Defined in:
- lib/logbrew/automatic_delivery.rb
Constant Summary collapse
- FIELDS =
%i[ state queued_events queued_bytes dropped_events in_flight last_outcome consecutive_failures pause_reason successful_flushes failed_flushes retry_delay_ms ].freeze
Instance Method Summary collapse
-
#initialize(**values) ⇒ DeliveryHealth
constructor
A new instance of DeliveryHealth.
- #to_h ⇒ Object
Constructor Details
#initialize(**values) ⇒ DeliveryHealth
Returns a new instance of DeliveryHealth.
12 13 14 15 |
# File 'lib/logbrew/automatic_delivery.rb', line 12 def initialize(**values) FIELDS.each { |field| instance_variable_set("@#{field}", values.fetch(field)) } freeze end |
Instance Method Details
#to_h ⇒ Object
17 18 19 20 21 |
# File 'lib/logbrew/automatic_delivery.rb', line 17 def to_h FIELDS.each_with_object({}) do |field, result| result[field.to_s] = public_send(field) end end |