Class: Tenet::Page

Inherits:
Object
  • Object
show all
Defined in:
lib/tenet/page.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url, parser = Nokogiri::HTML5) ⇒ Page



12
13
14
15
# File 'lib/tenet/page.rb', line 12

def initialize(url, parser = Nokogiri::HTML5)
  @html = URI.open(url).string
  @document = parser.parse(@html)
end

Instance Attribute Details

#documentObject

Returns the value of attribute document.



7
8
9
# File 'lib/tenet/page.rb', line 7

def document
  @document
end

#htmlObject

Returns the value of attribute html.



7
8
9
# File 'lib/tenet/page.rb', line 7

def html
  @html
end