Class: Menuconform::Finding
- Inherits:
-
Object
- Object
- Menuconform::Finding
- Defined in:
- lib/menuconform/finding.rb
Overview
One conformance finding. Severity is filled in by the engine from the rule catalog so rule implementations can never disagree with the published catalog.
Instance Attribute Summary collapse
-
#entity_id ⇒ Object
readonly
Returns the value of attribute entity_id.
-
#entity_type ⇒ Object
readonly
Returns the value of attribute entity_type.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#rule ⇒ Object
readonly
Returns the value of attribute rule.
-
#severity ⇒ Object
Returns the value of attribute severity.
Instance Method Summary collapse
-
#initialize(rule, entity_type, entity_id, message) ⇒ Finding
constructor
A new instance of Finding.
- #to_h ⇒ Object
Constructor Details
#initialize(rule, entity_type, entity_id, message) ⇒ Finding
Returns a new instance of Finding.
10 11 12 13 14 15 |
# File 'lib/menuconform/finding.rb', line 10 def initialize(rule, entity_type, entity_id, ) @rule = rule @entity_type = entity_type @entity_id = entity_id @message = end |
Instance Attribute Details
#entity_id ⇒ Object (readonly)
Returns the value of attribute entity_id.
7 8 9 |
# File 'lib/menuconform/finding.rb', line 7 def entity_id @entity_id end |
#entity_type ⇒ Object (readonly)
Returns the value of attribute entity_type.
7 8 9 |
# File 'lib/menuconform/finding.rb', line 7 def entity_type @entity_type end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
7 8 9 |
# File 'lib/menuconform/finding.rb', line 7 def @message end |
#rule ⇒ Object (readonly)
Returns the value of attribute rule.
7 8 9 |
# File 'lib/menuconform/finding.rb', line 7 def rule @rule end |
#severity ⇒ Object
Returns the value of attribute severity.
8 9 10 |
# File 'lib/menuconform/finding.rb', line 8 def severity @severity end |
Instance Method Details
#to_h ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/menuconform/finding.rb', line 17 def to_h { "rule" => rule, "severity" => severity, "entity" => { "type" => entity_type, "id" => entity_id }, "message" => } end |