Class: Eco::API::UseCases::GraphQL::Samples::Pages::Template::Deploy::Verifier::Verdict
- Inherits:
-
Struct
- Object
- Struct
- Eco::API::UseCases::GraphQL::Samples::Pages::Template::Deploy::Verifier::Verdict
- Defined in:
- lib/eco/api/usecases/graphql/samples/pages/template/deploy/verifier.rb
Overview
A verification verdict. pass? is the gate; findings carries per-check detail.
Instance Attribute Summary collapse
-
#findings ⇒ Object
Returns the value of attribute findings.
-
#pass ⇒ Object
Returns the value of attribute pass.
-
#verifier ⇒ Object
Returns the value of attribute verifier.
Instance Method Summary collapse
Instance Attribute Details
#findings ⇒ Object
Returns the value of attribute findings
19 20 21 |
# File 'lib/eco/api/usecases/graphql/samples/pages/template/deploy/verifier.rb', line 19 def findings @findings end |
#pass ⇒ Object
Returns the value of attribute pass
19 20 21 |
# File 'lib/eco/api/usecases/graphql/samples/pages/template/deploy/verifier.rb', line 19 def pass @pass end |
#verifier ⇒ Object
Returns the value of attribute verifier
19 20 21 |
# File 'lib/eco/api/usecases/graphql/samples/pages/template/deploy/verifier.rb', line 19 def verifier @verifier end |
Instance Method Details
#failures ⇒ Object
24 25 26 |
# File 'lib/eco/api/usecases/graphql/samples/pages/template/deploy/verifier.rb', line 24 def failures Array(findings).select { |f| %i[error fail].include?((f[:severity] || f['severity'])&.to_sym) } end |
#pass? ⇒ Boolean
20 21 22 |
# File 'lib/eco/api/usecases/graphql/samples/pages/template/deploy/verifier.rb', line 20 def pass? pass ? true : false end |
#report ⇒ Object
32 33 34 35 36 37 38 39 |
# File 'lib/eco/api/usecases/graphql/samples/pages/template/deploy/verifier.rb', line 32 def report head = "VERIFY (#{verifier}): #{pass? ? 'PASS' : 'FAIL'}" return head if Array(findings).empty? ([head] + Array(findings).map do |f| " - [#{f[:severity] || f['severity']}] #{f[:message] || f['message']}" end).join("\n") end |
#to_h ⇒ Object
28 29 30 |
# File 'lib/eco/api/usecases/graphql/samples/pages/template/deploy/verifier.rb', line 28 def to_h { pass: pass?, verifier: verifier, findings: Array(findings) } end |