Class: Dash::Dockerfile::Finding
- Inherits:
-
Struct
- Object
- Struct
- Dash::Dockerfile::Finding
- Defined in:
- lib/dash/dockerfile/finding.rb
Overview
One piece of advice about the Dockerfile or the build context.
rule is a stable public string an operator can put in report: ignore:, so renaming
one is a breaking change to their deploy.yml. location is whatever they should open:
a Dockerfile line, .dockerignore, build context, or a deploy.yml key.
Instance Attribute Summary collapse
-
#location ⇒ Object
Returns the value of attribute location.
-
#message ⇒ Object
Returns the value of attribute message.
-
#rule ⇒ Object
Returns the value of attribute rule.
-
#severity ⇒ Object
Returns the value of attribute severity.
-
#suggestion ⇒ Object
Returns the value of attribute suggestion.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#location ⇒ Object
Returns the value of attribute location
6 7 8 |
# File 'lib/dash/dockerfile/finding.rb', line 6 def location @location end |
#message ⇒ Object
Returns the value of attribute message
6 7 8 |
# File 'lib/dash/dockerfile/finding.rb', line 6 def end |
#rule ⇒ Object
Returns the value of attribute rule
6 7 8 |
# File 'lib/dash/dockerfile/finding.rb', line 6 def rule @rule end |
#severity ⇒ Object
Returns the value of attribute severity
6 7 8 |
# File 'lib/dash/dockerfile/finding.rb', line 6 def severity @severity end |
#suggestion ⇒ Object
Returns the value of attribute suggestion
6 7 8 |
# File 'lib/dash/dockerfile/finding.rb', line 6 def suggestion @suggestion end |
Class Method Details
.from_h(hash) ⇒ Object
11 12 13 14 15 |
# File 'lib/dash/dockerfile/finding.rb', line 11 def self.from_h(hash) hash = hash.transform_keys(&:to_sym) new(**hash.slice(:rule, :location, :message, :suggestion), severity: hash[:severity].to_sym) end |
Instance Method Details
#to_h ⇒ Object
17 18 19 |
# File 'lib/dash/dockerfile/finding.rb', line 17 def to_h { rule: rule, severity: severity.to_s, location: location, message: , suggestion: suggestion } end |
#warn? ⇒ Boolean
7 8 9 |
# File 'lib/dash/dockerfile/finding.rb', line 7 def warn? severity == :warn end |