Class: SiteHealth::Checkers::XMLPage

Inherits:
Object
  • Object
show all
Defined in:
lib/site_health/checkers/xml_page.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(page) ⇒ XMLPage

Returns a new instance of XMLPage.

Parameters:

  • the (Spidr::Page)

    crawled page



11
12
13
14
# File 'lib/site_health/checkers/xml_page.rb', line 11

def initialize(page)
  @page = page
  @url = page.url
end

Instance Attribute Details

#pageObject (readonly)

Returns the value of attribute page.



8
9
10
# File 'lib/site_health/checkers/xml_page.rb', line 8

def page
  @page
end

#urlObject (readonly)

Returns the value of attribute url.



8
9
10
# File 'lib/site_health/checkers/xml_page.rb', line 8

def url
  @url
end

Class Method Details

.check(page) ⇒ Object



4
5
6
# File 'lib/site_health/checkers/xml_page.rb', line 4

def self.check(page)
  new(page).check
end

Instance Method Details

#checkObject



16
17
18
# File 'lib/site_health/checkers/xml_page.rb', line 16

def check
  XMLJournal.new(url: url, page: page, errors: page.doc.errors)
end