Class: Tenet::Page
- Inherits:
-
Object
- Object
- Tenet::Page
- Defined in:
- lib/tenet/page.rb
Instance Attribute Summary collapse
-
#document ⇒ Object
Returns the value of attribute document.
-
#html ⇒ Object
Returns the value of attribute html.
Instance Method Summary collapse
-
#initialize(url, parser = Nokogiri::HTML5) ⇒ Page
constructor
A new instance of Page.
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
#document ⇒ Object
Returns the value of attribute document.
7 8 9 |
# File 'lib/tenet/page.rb', line 7 def document @document end |
#html ⇒ Object
Returns the value of attribute html.
7 8 9 |
# File 'lib/tenet/page.rb', line 7 def html @html end |