Class: AnalyticsOps::Workspace::DoctorResult
- Inherits:
-
Object
- Object
- AnalyticsOps::Workspace::DoctorResult
- Defined in:
- lib/analytics_ops/workspace.rb,
sig/analytics_ops.rbs
Overview
Immutable health-check collection returned by doctor.
Instance Attribute Summary collapse
-
#checks ⇒ Array[record]
readonly
Returns the value of attribute checks.
Instance Method Summary collapse
-
#initialize(checks:) ⇒ DoctorResult
constructor
A new instance of DoctorResult.
- #success? ⇒ Boolean
- #to_h ⇒ record
Constructor Details
#initialize(checks:) ⇒ DoctorResult
Returns a new instance of DoctorResult.
31 32 33 34 |
# File 'lib/analytics_ops/workspace.rb', line 31 def initialize(checks:) @checks = Canonical.immutable(checks) freeze end |
Instance Attribute Details
#checks ⇒ Array[record] (readonly)
Returns the value of attribute checks.
29 30 31 |
# File 'lib/analytics_ops/workspace.rb', line 29 def checks @checks end |
Instance Method Details
#success? ⇒ Boolean
36 37 38 |
# File 'lib/analytics_ops/workspace.rb', line 36 def success? checks.none? { |check| check.fetch("status") == "error" } end |
#to_h ⇒ record
40 41 42 |
# File 'lib/analytics_ops/workspace.rb', line 40 def to_h { "success" => success?, "checks" => checks } end |