Class: TWFilter::Finding
- Inherits:
-
Data
- Object
- Data
- TWFilter::Finding
- Defined in:
- lib/twfilter/finding.rb,
sig/twfilter.rbs
Instance Attribute Summary collapse
-
#check ⇒ Object
readonly
Returns the value of attribute check.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#detail ⇒ Object
readonly
Returns the value of attribute detail.
-
#severity ⇒ Object
readonly
Returns the value of attribute severity.
Instance Method Summary collapse
-
#initialize(check:, code:, severity: :reject, detail: nil) ⇒ Finding
constructor
A new instance of Finding.
- #mark? ⇒ Boolean
- #reject? ⇒ Boolean
- #to_h ⇒ ::Hash[::Symbol, untyped]
Constructor Details
#initialize(check:, code:, severity: :reject, detail: nil) ⇒ Finding
Returns a new instance of Finding.
9 10 11 |
# File 'lib/twfilter/finding.rb', line 9 def initialize(check:, code:, severity: :reject, detail: nil) super end |
Instance Attribute Details
#check ⇒ Object (readonly)
Returns the value of attribute check
8 9 10 |
# File 'lib/twfilter/finding.rb', line 8 def check @check end |
#code ⇒ Object (readonly)
Returns the value of attribute code
8 9 10 |
# File 'lib/twfilter/finding.rb', line 8 def code @code end |
#detail ⇒ Object (readonly)
Returns the value of attribute detail
8 9 10 |
# File 'lib/twfilter/finding.rb', line 8 def detail @detail end |
#severity ⇒ Object (readonly)
Returns the value of attribute severity
8 9 10 |
# File 'lib/twfilter/finding.rb', line 8 def severity @severity end |
Instance Method Details
#mark? ⇒ Boolean
15 |
# File 'lib/twfilter/finding.rb', line 15 def mark? = severity == :mark |
#reject? ⇒ Boolean
13 |
# File 'lib/twfilter/finding.rb', line 13 def reject? = severity == :reject |
#to_h ⇒ ::Hash[::Symbol, untyped]
17 |
# File 'lib/twfilter/finding.rb', line 17 def to_h = {check: check.to_s, code: code.to_s, severity: severity.to_s, detail: detail}.compact |