Class: Crawlscope::Rules::Indexability

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

Constant Summary collapse

ROBOTS_META_SELECTOR =
'meta[name="robots"], meta[name="googlebot"]'
X_ROBOTS_TAG_HEADER =
"x-robots-tag"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeIndexability

Returns a new instance of Indexability.



11
12
13
# File 'lib/crawlscope/rules/indexability.rb', line 11

def initialize
  @code = :indexability
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



9
10
11
# File 'lib/crawlscope/rules/indexability.rb', line 9

def code
  @code
end

Instance Method Details

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



15
16
17
18
19
20
# File 'lib/crawlscope/rules/indexability.rb', line 15

def call(urls:, pages:, issues:, context: nil)
  pages.each do |page|
    validate_meta_robots(page, issues) if page.html?
    validate_x_robots_tag(page, issues)
  end
end