Class: SpecyDocs::ReportGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/specy_docs/report_generator.rb

Defined Under Namespace

Classes: InvalidCaptureFileError

Constant Summary collapse

HTTP_METHODS =
%w[get put post delete].freeze

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(capture_file:, output_file:) ⇒ ReportGenerator

Returns a new instance of ReportGenerator.



19
20
21
22
# File 'lib/specy_docs/report_generator.rb', line 19

def initialize(capture_file:, output_file:)
  @capture_file = Pathname(capture_file)
  @output_file = Pathname(output_file)
end

Class Method Details

.call(capture_file: nil, output_file: nil) ⇒ Object



12
13
14
15
16
17
# File 'lib/specy_docs/report_generator.rb', line 12

def self.call(capture_file: nil, output_file: nil)
  new(
    capture_file: capture_file || SpecyDocs.configuration.resolved_capture_path,
    output_file: output_file || SpecyDocs.configuration.resolved_report_path
  ).call
end

Instance Method Details

#callObject



24
25
26
27
28
# File 'lib/specy_docs/report_generator.rb', line 24

def call
  report = build_report
  write_report(report)
  report
end