Class: TWFilter::Report
- Inherits:
-
Data
- Object
- Data
- TWFilter::Report
- Defined in:
- lib/twfilter/finding.rb,
sig/twfilter.rbs
Instance Attribute Summary collapse
-
#evidence ⇒ Object
readonly
Returns the value of attribute evidence.
-
#findings ⇒ Object
readonly
Returns the value of attribute findings.
-
#han ⇒ Object
readonly
Returns the value of attribute han.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#tier ⇒ Object
readonly
Returns the value of attribute tier.
Instance Method Summary collapse
- #codes ⇒ ::Array[::Symbol]
- #marks ⇒ ::Array[Finding]
- #ok? ⇒ Boolean
- #reasons ⇒ ::Array[::String]
- #rejects ⇒ ::Array[Finding]
- #to_h ⇒ ::Hash[::Symbol, untyped]
Instance Attribute Details
#evidence ⇒ Object (readonly)
Returns the value of attribute evidence
20 21 22 |
# File 'lib/twfilter/finding.rb', line 20 def evidence @evidence end |
#findings ⇒ Object (readonly)
Returns the value of attribute findings
20 21 22 |
# File 'lib/twfilter/finding.rb', line 20 def findings @findings end |
#han ⇒ Object (readonly)
Returns the value of attribute han
20 21 22 |
# File 'lib/twfilter/finding.rb', line 20 def han @han end |
#text ⇒ Object (readonly)
Returns the value of attribute text
20 21 22 |
# File 'lib/twfilter/finding.rb', line 20 def text @text end |
#tier ⇒ Object (readonly)
Returns the value of attribute tier
20 21 22 |
# File 'lib/twfilter/finding.rb', line 20 def tier @tier end |
Instance Method Details
#codes ⇒ ::Array[::Symbol]
27 |
# File 'lib/twfilter/finding.rb', line 27 def codes = findings.map(&:code) |
#marks ⇒ ::Array[Finding]
25 |
# File 'lib/twfilter/finding.rb', line 25 def marks = findings.select(&:mark?) |
#ok? ⇒ Boolean
21 |
# File 'lib/twfilter/finding.rb', line 21 def ok? = findings.none?(&:reject?) |
#reasons ⇒ ::Array[::String]
29 |
# File 'lib/twfilter/finding.rb', line 29 def reasons = rejects.map { |finding| [finding.code, finding.detail].compact.join(": ") } |
#rejects ⇒ ::Array[Finding]
23 |
# File 'lib/twfilter/finding.rb', line 23 def rejects = findings.select(&:reject?) |
#to_h ⇒ ::Hash[::Symbol, untyped]
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/twfilter/finding.rb', line 31 def to_h { text: text, ok: ok?, tier: tier, han: han, evidence: evidence, findings: findings.map(&:to_h) } end |