Class: Moult::Health::Score::Reason

Inherits:
Struct
  • Object
show all
Defined in:
lib/moult/health/score.rb

Overview

One auditable observation behind a sub-score. Mirrors the rule/.../detail reason shape used across Moult, but health sub-scores are RATIOS not signed delta-sums, so it carries the observed value (a [0, 1] quantity) rather than a delta. Kept local so the health slice does not couple to the dead-code or duplication Reason structs.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#detailObject

Returns the value of attribute detail

Returns:

  • (Object)

    the current value of detail



83
84
85
# File 'lib/moult/health/score.rb', line 83

def detail
  @detail
end

#ruleObject

Returns the value of attribute rule

Returns:

  • (Object)

    the current value of rule



83
84
85
# File 'lib/moult/health/score.rb', line 83

def rule
  @rule
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



83
84
85
# File 'lib/moult/health/score.rb', line 83

def value
  @value
end

Instance Method Details

#to_hObject



84
85
86
# File 'lib/moult/health/score.rb', line 84

def to_h
  {rule: rule.to_s, value: value, detail: detail}
end