Class: VoiceML::HealthStatus
- Inherits:
-
Object
- Object
- VoiceML::HealthStatus
- Defined in:
- lib/voiceml/models/diagnostics.rb
Overview
‘GET /health` response. Hard-check failures flip `ok` to false (server returns 503); soft-check warnings surface in `warnings` only.
Instance Attribute Summary collapse
-
#failures ⇒ Object
readonly
Returns the value of attribute failures.
-
#ok ⇒ Object
readonly
Returns the value of attribute ok.
-
#warnings ⇒ Object
readonly
Returns the value of attribute warnings.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(hash = {}) ⇒ HealthStatus
constructor
A new instance of HealthStatus.
Constructor Details
#initialize(hash = {}) ⇒ HealthStatus
Returns a new instance of HealthStatus.
46 47 48 49 50 |
# File 'lib/voiceml/models/diagnostics.rb', line 46 def initialize(hash = {}) @ok = hash['ok'] @warnings = (hash['warnings'] || []).map { |w| HealthFailure.from_hash(w) } @failures = (hash['failures'] || []).map { |f| HealthFailure.from_hash(f) } end |
Instance Attribute Details
#failures ⇒ Object (readonly)
Returns the value of attribute failures.
44 45 46 |
# File 'lib/voiceml/models/diagnostics.rb', line 44 def failures @failures end |
#ok ⇒ Object (readonly)
Returns the value of attribute ok.
44 45 46 |
# File 'lib/voiceml/models/diagnostics.rb', line 44 def ok @ok end |
#warnings ⇒ Object (readonly)
Returns the value of attribute warnings.
44 45 46 |
# File 'lib/voiceml/models/diagnostics.rb', line 44 def warnings @warnings end |
Class Method Details
.from_hash(hash) ⇒ Object
52 53 54 |
# File 'lib/voiceml/models/diagnostics.rb', line 52 def self.from_hash(hash) new(hash || {}) end |