Class: Moult::FlagsReport::Finding
- Inherits:
-
Struct
- Object
- Struct
- Moult::FlagsReport::Finding
- Defined in:
- lib/moult/flags_report.rb
Overview
One flag key. Carries its classification (value_type / reference_count /
default_values) and reasons so the catalogue is auditable. staleness is a
Moult::Flags::Staleness::Assessment when a provider snapshot was merged, else nil.
confidence is the staleness candidate's confidence when graded, else null (a
reference alone is a fact, the signal is the classification).
Instance Attribute Summary collapse
-
#default_values ⇒ Object
Returns the value of attribute default_values.
-
#flag_key ⇒ Object
Returns the value of attribute flag_key.
-
#occurrences ⇒ Object
Returns the value of attribute occurrences.
-
#reasons ⇒ Object
Returns the value of attribute reasons.
-
#reference_count ⇒ Object
Returns the value of attribute reference_count.
-
#staleness ⇒ Object
Returns the value of attribute staleness.
-
#value_type ⇒ Object
Returns the value of attribute value_type.
Instance Method Summary collapse
Instance Attribute Details
#default_values ⇒ Object
Returns the value of attribute default_values
42 43 44 |
# File 'lib/moult/flags_report.rb', line 42 def default_values @default_values end |
#flag_key ⇒ Object
Returns the value of attribute flag_key
42 43 44 |
# File 'lib/moult/flags_report.rb', line 42 def flag_key @flag_key end |
#occurrences ⇒ Object
Returns the value of attribute occurrences
42 43 44 |
# File 'lib/moult/flags_report.rb', line 42 def occurrences @occurrences end |
#reasons ⇒ Object
Returns the value of attribute reasons
42 43 44 |
# File 'lib/moult/flags_report.rb', line 42 def reasons @reasons end |
#reference_count ⇒ Object
Returns the value of attribute reference_count
42 43 44 |
# File 'lib/moult/flags_report.rb', line 42 def reference_count @reference_count end |
#staleness ⇒ Object
Returns the value of attribute staleness
42 43 44 |
# File 'lib/moult/flags_report.rb', line 42 def staleness @staleness end |
#value_type ⇒ Object
Returns the value of attribute value_type
42 43 44 |
# File 'lib/moult/flags_report.rb', line 42 def value_type @value_type end |
Instance Method Details
#to_h ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/moult/flags_report.rb', line 43 def to_h h = { category: Flags::Classification::CATEGORY, confidence: staleness&.confidence, flag_key: flag_key, value_type: value_type, reference_count: reference_count, default_values: default_values, reasons: reasons.map(&:to_h), occurrences: occurrences.map(&:to_h) } # Additive: the staleness block appears only when graded, leaving the v1 # finding byte-for-byte unchanged (confidence stays null, no extra key). h[:staleness] = staleness.to_h if staleness h end |