Class: Korfzone::Scraper::Page

Inherits:
Object
  • Object
show all
Includes:
BlockPage, GamesPage
Defined in:
lib/korfzone/scraper/page.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from GamesPage

#category, #competition, #games

Methods included from BlockPage

#block_pages, #block_uris

Constructor Details

#initialize(url) ⇒ Page

Returns a new instance of Page.



18
19
20
# File 'lib/korfzone/scraper/page.rb', line 18

def initialize( url )
  @url = URI( URI.escape url.to_s )
end

Instance Attribute Details

#urlObject

Returns the value of attribute url.



16
17
18
# File 'lib/korfzone/scraper/page.rb', line 16

def url
  @url
end

Instance Method Details

#==(other_page) ⇒ Object



26
27
28
# File 'lib/korfzone/scraper/page.rb', line 26

def ==( other_page )
  other_page.respond_to?( :url ) && other_page.url == url
end

#documentObject



22
23
24
# File 'lib/korfzone/scraper/page.rb', line 22

def document
  @document ||= Nokogiri::HTML( ::Korfzone::Scraper.fetch url )
end