Class: Crawlscope::StructuredData::Check

Inherits:
Object
  • Object
show all
Defined in:
lib/crawlscope/structured_data/check.rb

Instance Method Summary collapse

Constructor Details

#initialize(configuration:) ⇒ Check

Returns a new instance of Check.



6
7
8
# File 'lib/crawlscope/structured_data/check.rb', line 6

def initialize(configuration:)
  @configuration = configuration
end

Instance Method Details

#call(urls:, debug: false, renderer: @configuration.renderer, timeout_seconds: @configuration.timeout_seconds, report_path: nil, summary: false) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/crawlscope/structured_data/check.rb', line 10

def call(urls:, debug: false, renderer: @configuration.renderer, timeout_seconds: @configuration.timeout_seconds, report_path: nil, summary: false)
  result = audit(renderer: renderer, timeout_seconds: timeout_seconds).call(urls: urls)
  reporter = Reporter.new(io: @configuration.output, report_path: report_path)

  reporter.details(result, debug: debug, renderer: renderer)
  Writer.new(path: report_path).write(result) if report_path
  reporter.report(result) if summary

  result
end