Class: Crawlscope::Rules::StructuredData

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeStructuredData

Returns a new instance of StructuredData.



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

def initialize
  @code = :structured_data
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



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

def code
  @code
end

Instance Method Details

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



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

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