Class: Crawlscope::Rules::StructuredData

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

Constant Summary collapse

CAREER_DETAIL_PATH =
%r{/careers/[^/]+/?\z}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeStructuredData

Returns a new instance of StructuredData.



10
11
12
# File 'lib/crawlscope/rules/structured_data.rb', line 10

def initialize
  @code = :structured_data
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



8
9
10
# File 'lib/crawlscope/rules/structured_data.rb', line 8

def code
  @code
end

Instance Method Details

#call(urls:, pages:, issues:, context:) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/crawlscope/rules/structured_data.rb', line 14

def call(urls:, pages:, issues:, context:)
  schema_registry = context.fetch(:schema_registry)

  pages.each do |page|
    next unless page.html?

    validate_page(page, issues, schema_registry)
  end
end