Class: Igniter::Contracts::Execution::ValidationFinding
- Inherits:
-
Object
- Object
- Igniter::Contracts::Execution::ValidationFinding
- Defined in:
- lib/igniter/contracts/execution/validation_finding.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#subjects ⇒ Object
readonly
Returns the value of attribute subjects.
Instance Method Summary collapse
-
#initialize(code:, message:, subjects: [], metadata: {}) ⇒ ValidationFinding
constructor
A new instance of ValidationFinding.
- #to_h ⇒ Object
Constructor Details
#initialize(code:, message:, subjects: [], metadata: {}) ⇒ ValidationFinding
Returns a new instance of ValidationFinding.
9 10 11 12 13 14 15 |
# File 'lib/igniter/contracts/execution/validation_finding.rb', line 9 def initialize(code:, message:, subjects: [], metadata: {}) @code = code.to_sym @message = @subjects = Array(subjects).map(&:to_sym).freeze @metadata = .freeze freeze end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
7 8 9 |
# File 'lib/igniter/contracts/execution/validation_finding.rb', line 7 def code @code end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
7 8 9 |
# File 'lib/igniter/contracts/execution/validation_finding.rb', line 7 def @message end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
7 8 9 |
# File 'lib/igniter/contracts/execution/validation_finding.rb', line 7 def @metadata end |
#subjects ⇒ Object (readonly)
Returns the value of attribute subjects.
7 8 9 |
# File 'lib/igniter/contracts/execution/validation_finding.rb', line 7 def subjects @subjects end |
Instance Method Details
#to_h ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/igniter/contracts/execution/validation_finding.rb', line 17 def to_h { code: code, message: , subjects: subjects, metadata: StructuredDump.dump() } end |