Class: AnalyticsOps::Plan::Finding

Inherits:
Resources::Value show all
Defined in:
lib/analytics_ops/plan.rb,
sig/analytics_ops.rbs

Overview

Read-only drift, manual, or experimental information attached to a plan.

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Resources::Value

#==, fields, #hash, #initialize, #to_h

Constructor Details

This class inherits a constructor from AnalyticsOps::Resources::Value

Instance Attribute Details

#codeString (readonly)

Returns the value of attribute code.

Returns:

  • (String)


288
289
290
# File 'sig/analytics_ops.rbs', line 288

def code
  @code
end

#messageString (readonly)

Returns the value of attribute message.

Returns:

  • (String)


290
291
292
# File 'sig/analytics_ops.rbs', line 290

def message
  @message
end

#resource_identityString (readonly)

Returns the value of attribute resource_identity.

Returns:

  • (String)


289
290
291
# File 'sig/analytics_ops.rbs', line 289

def resource_identity
  @resource_identity
end

#severityString (readonly)

Returns the value of attribute severity.

Returns:

  • (String)


287
288
289
# File 'sig/analytics_ops.rbs', line 287

def severity
  @severity
end

Class Method Details

.from_h(raw) ⇒ Finding

Parameters:

  • raw (record)

Returns:



183
184
185
186
187
188
189
# File 'lib/analytics_ops/plan.rb', line 183

def self.from_h(raw)
  hash = Plan.string_keyed_hash(raw, "finding")
  Plan.exact_keys!(hash, field_names.map(&:to_s), "finding")
  new(**field_names.to_h { |name| [name, hash.fetch(name.to_s)] })
rescue KeyError => error
  raise InvalidPlanError, "Missing plan finding field #{error.key}"
end