Class: Pumi::DataSource::Wikipedia::WebScraper

Inherits:
Object
  • Object
show all
Defined in:
lib/pumi/data_source/wikipedia.rb

Defined Under Namespace

Classes: ElementNotFoundError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url) ⇒ WebScraper

Returns a new instance of WebScraper.



51
52
53
# File 'lib/pumi/data_source/wikipedia.rb', line 51

def initialize(url)
  @url = url
end

Instance Attribute Details

#urlObject (readonly)

Returns the value of attribute url.



49
50
51
# File 'lib/pumi/data_source/wikipedia.rb', line 49

def url
  @url
end

Instance Method Details

#pageObject



55
56
57
# File 'lib/pumi/data_source/wikipedia.rb', line 55

def page
  @page ||= Nokogiri::HTML(URI.parse(url).open)
end