Class: XfnStone::Document
- Inherits:
-
Object
- Object
- XfnStone::Document
- Defined in:
- lib/xfn_stone/document.rb
Overview
This is an empty subclass of hpricot. Substuting a different XML parser in the future will be easier this way. Also a useful spot for future helpers.
Class Method Summary collapse
- .create_from_uri(uri) ⇒ Object
-
.open(url) ⇒ Object
allow the open-uri call to be stubed.
Instance Method Summary collapse
Class Method Details
.create_from_uri(uri) ⇒ Object
20 21 22 23 24 |
# File 'lib/xfn_stone/document.rb', line 20 def self.create_from_uri(uri) document = Document.new document.load_from_uri(uri) return document end |
.open(url) ⇒ Object
allow the open-uri call to be stubed
36 37 38 |
# File 'lib/xfn_stone/document.rb', line 36 def self.open(url) Kernel.open(url) end |
Instance Method Details
#elements(xpath) ⇒ Object
31 32 33 |
# File 'lib/xfn_stone/document.rb', line 31 def elements(xpath) (@document/xpath) end |