Class: Omamori::ReportGenerator::JSONFormatter
- Inherits:
-
Object
- Object
- Omamori::ReportGenerator::JSONFormatter
- Defined in:
- lib/omamori/report_generator/json_formatter.rb
Instance Method Summary collapse
- #format(analysis_result) ⇒ Object
-
#initialize(output_path_prefix) ⇒ JSONFormatter
constructor
A new instance of JSONFormatter.
Constructor Details
#initialize(output_path_prefix) ⇒ JSONFormatter
Returns a new instance of JSONFormatter.
8 9 10 |
# File 'lib/omamori/report_generator/json_formatter.rb', line 8 def initialize(output_path_prefix) @output_path_prefix = output_path_prefix end |
Instance Method Details
#format(analysis_result) ⇒ Object
12 13 14 15 16 |
# File 'lib/omamori/report_generator/json_formatter.rb', line 12 def format(analysis_result) # Convert the analysis result (Ruby Hash/Array) to a JSON string # Use pretty_generate for readability JSON.pretty_generate(analysis_result) end |