Class: Necropsy::Finding
- Inherits:
-
Data
- Object
- Data
- Necropsy::Finding
- Defined in:
- lib/necropsy/models.rb
Instance Attribute Summary collapse
-
#blockers ⇒ Object
readonly
Returns the value of attribute blockers.
-
#classification ⇒ Object
readonly
Returns the value of attribute classification.
-
#confidence ⇒ Object
readonly
Returns the value of attribute confidence.
-
#evidences ⇒ Object
readonly
Returns the value of attribute evidences.
-
#node ⇒ Object
readonly
Returns the value of attribute node.
-
#reasons ⇒ Object
readonly
Returns the value of attribute reasons.
-
#score ⇒ Object
readonly
Returns the value of attribute score.
-
#score_components ⇒ Object
readonly
Returns the value of attribute score_components.
Instance Method Summary collapse
- #at_least?(level) ⇒ Boolean
- #fingerprint ⇒ Object (also: #logical_fingerprint)
-
#initialize(node:, classification:, confidence:, score:, score_components:, reasons:, evidences:, blockers: []) ⇒ Finding
constructor
A new instance of Finding.
- #physical_fingerprint ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(node:, classification:, confidence:, score:, score_components:, reasons:, evidences:, blockers: []) ⇒ Finding
Returns a new instance of Finding.
1003 1004 1005 |
# File 'lib/necropsy/models.rb', line 1003 def initialize(node:, classification:, confidence:, score:, score_components:, reasons:, evidences:, blockers: []) super end |
Instance Attribute Details
#blockers ⇒ Object (readonly)
Returns the value of attribute blockers
1002 1003 1004 |
# File 'lib/necropsy/models.rb', line 1002 def blockers @blockers end |
#classification ⇒ Object (readonly)
Returns the value of attribute classification
1002 1003 1004 |
# File 'lib/necropsy/models.rb', line 1002 def classification @classification end |
#confidence ⇒ Object (readonly)
Returns the value of attribute confidence
1002 1003 1004 |
# File 'lib/necropsy/models.rb', line 1002 def confidence @confidence end |
#evidences ⇒ Object (readonly)
Returns the value of attribute evidences
1002 1003 1004 |
# File 'lib/necropsy/models.rb', line 1002 def evidences @evidences end |
#node ⇒ Object (readonly)
Returns the value of attribute node
1002 1003 1004 |
# File 'lib/necropsy/models.rb', line 1002 def node @node end |
#reasons ⇒ Object (readonly)
Returns the value of attribute reasons
1002 1003 1004 |
# File 'lib/necropsy/models.rb', line 1002 def reasons @reasons end |
#score ⇒ Object (readonly)
Returns the value of attribute score
1002 1003 1004 |
# File 'lib/necropsy/models.rb', line 1002 def score @score end |
#score_components ⇒ Object (readonly)
Returns the value of attribute score_components
1002 1003 1004 |
# File 'lib/necropsy/models.rb', line 1002 def score_components @score_components end |
Instance Method Details
#at_least?(level) ⇒ Boolean
1007 1008 1009 |
# File 'lib/necropsy/models.rb', line 1007 def at_least?(level) CONFIDENCE_LEVELS.fetch(confidence) >= CONFIDENCE_LEVELS.fetch(level) end |
#fingerprint ⇒ Object Also known as: logical_fingerprint
1011 1012 1013 |
# File 'lib/necropsy/models.rb', line 1011 def fingerprint node.fingerprint(classification) end |
#physical_fingerprint ⇒ Object
1017 1018 1019 |
# File 'lib/necropsy/models.rb', line 1017 def physical_fingerprint node.physical_fingerprint(classification) end |
#to_h ⇒ Object
1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 |
# File 'lib/necropsy/models.rb', line 1021 def to_h { 'fingerprint' => fingerprint, 'logical_fingerprint' => logical_fingerprint, 'physical_fingerprint' => physical_fingerprint, 'classification' => classification.to_s, 'confidence' => confidence.to_s, 'score' => score, 'score_components' => score_components.map(&:to_h), 'node' => node.to_h, 'reasons' => reasons, 'evidences' => evidences.map(&:to_h), 'blockers' => blockers.map(&:to_h) } end |