Class: AnalyticsOps::Workspace::DoctorResult

Inherits:
Object
  • Object
show all
Defined in:
lib/analytics_ops/workspace.rb,
sig/analytics_ops.rbs

Overview

Immutable health-check collection returned by doctor.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(checks:) ⇒ DoctorResult

Returns a new instance of DoctorResult.

Parameters:

  • checks: (Array[record])


31
32
33
34
# File 'lib/analytics_ops/workspace.rb', line 31

def initialize(checks:)
  @checks = Canonical.immutable(checks)
  freeze
end

Instance Attribute Details

#checksArray[record] (readonly)

Returns the value of attribute checks.

Returns:

  • (Array[record])


29
30
31
# File 'lib/analytics_ops/workspace.rb', line 29

def checks
  @checks
end

Instance Method Details

#success?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/analytics_ops/workspace.rb', line 36

def success?
  checks.none? { |check| check.fetch("status") == "error" }
end

#to_hrecord

Returns:

  • (record)


40
41
42
# File 'lib/analytics_ops/workspace.rb', line 40

def to_h
  { "success" => success?, "checks" => checks }
end