Class: CCEngine::Issue
- Inherits:
-
Object
- Object
- CCEngine::Issue
- Defined in:
- lib/cc_engine/issue.rb
Instance Method Summary collapse
-
#initialize(check_name:, description:, categories:, location:, remediation_points:, content:, fingerprint:) ⇒ Issue
constructor
A new instance of Issue.
- #render ⇒ Object
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(check_name:, description:, categories:, location:, remediation_points:, content:, fingerprint:) ⇒ Issue
Returns a new instance of Issue.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/cc_engine/issue.rb', line 6 def initialize( check_name:, description:, categories:, location:, remediation_points:, content:, fingerprint: ) @check_name = check_name @description = description @categories = categories @location = location @remediation_points = remediation_points @content = content @fingerprint = fingerprint end |
Instance Method Details
#render ⇒ Object
24 25 26 |
# File 'lib/cc_engine/issue.rb', line 24 def render to_hash.to_json + "\0" end |
#to_hash ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'lib/cc_engine/issue.rb', line 32 def to_hash { type: "issue", check_name: check_name, description: description, categories: categories, location: location.to_hash }.merge(remediation_points_hash).merge(content_hash).merge(fingerprint_hash) end |
#to_json ⇒ Object
28 29 30 |
# File 'lib/cc_engine/issue.rb', line 28 def to_json to_hash.to_json end |