Class: CleoQualityReview::RunArtifacts::RawCheckOutputs::Record
- Inherits:
-
Struct
- Object
- Struct
- CleoQualityReview::RunArtifacts::RawCheckOutputs::Record
- Defined in:
- lib/cleo_quality_review/run_artifacts/raw_check_outputs.rb
Overview
Raw output content and metadata for one quality check.
Instance Attribute Summary collapse
-
#check_name ⇒ Object
Returns the value of attribute check_name.
-
#extension ⇒ Object
Returns the value of attribute extension.
-
#path ⇒ Object
Returns the value of attribute path.
-
#raw_output ⇒ Object
Returns the value of attribute raw_output.
-
#tool_name ⇒ Object
Returns the value of attribute tool_name.
-
#tool_type ⇒ Object
Returns the value of attribute tool_type.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#check_name ⇒ Object
Returns the value of attribute check_name
12 13 14 |
# File 'lib/cleo_quality_review/run_artifacts/raw_check_outputs.rb', line 12 def check_name @check_name end |
#extension ⇒ Object
Returns the value of attribute extension
12 13 14 |
# File 'lib/cleo_quality_review/run_artifacts/raw_check_outputs.rb', line 12 def extension @extension end |
#path ⇒ Object
Returns the value of attribute path
12 13 14 |
# File 'lib/cleo_quality_review/run_artifacts/raw_check_outputs.rb', line 12 def path @path end |
#raw_output ⇒ Object
Returns the value of attribute raw_output
12 13 14 |
# File 'lib/cleo_quality_review/run_artifacts/raw_check_outputs.rb', line 12 def raw_output @raw_output end |
#tool_name ⇒ Object
Returns the value of attribute tool_name
12 13 14 |
# File 'lib/cleo_quality_review/run_artifacts/raw_check_outputs.rb', line 12 def tool_name @tool_name end |
#tool_type ⇒ Object
Returns the value of attribute tool_type
12 13 14 |
# File 'lib/cleo_quality_review/run_artifacts/raw_check_outputs.rb', line 12 def tool_type @tool_type end |
Class Method Details
.from_path(filepath:, check_name:, tool_type:) ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/cleo_quality_review/run_artifacts/raw_check_outputs.rb', line 13 def self.from_path(filepath:, check_name:, tool_type:) new( check_name: check_name, tool_name: check_name, tool_type: tool_type, extension: File.extname(filepath).delete_prefix("."), path: filepath, raw_output: File.read(filepath, invalid: :replace, undef: :replace), ) end |
Instance Method Details
#to_h ⇒ Object
32 33 34 35 36 37 38 39 40 41 |
# File 'lib/cleo_quality_review/run_artifacts/raw_check_outputs.rb', line 32 def to_h { check_name: check_name, tool_name: tool_name, tool_type: tool_type, extension: extension, path: path, raw_output: raw_output, }.compact end |
#to_pair ⇒ Object
24 25 26 |
# File 'lib/cleo_quality_review/run_artifacts/raw_check_outputs.rb', line 24 def to_pair [check_name, raw_output] end |
#to_record_pair ⇒ Object
28 29 30 |
# File 'lib/cleo_quality_review/run_artifacts/raw_check_outputs.rb', line 28 def to_record_pair [check_name, self] end |