Class: Rexle::Recordset
- Inherits:
-
Array
- Object
- Array
- Rexle::Recordset
- Defined in:
- lib/rexle.rb
Instance Method Summary collapse
- #element(xpath) ⇒ Object
-
#initialize(a) ⇒ Recordset
constructor
A new instance of Recordset.
- #to_doc(root: 'root') ⇒ Object
- #xpath(xpath) ⇒ Object
Constructor Details
#initialize(a) ⇒ Recordset
Returns a new instance of Recordset.
1563 1564 1565 |
# File 'lib/rexle.rb', line 1563 def initialize(a) super(a) end |
Instance Method Details
#element(xpath) ⇒ Object
1578 1579 1580 |
# File 'lib/rexle.rb', line 1578 def element(xpath) self.to_doc.root.element(xpath) end |
#to_doc(root: 'root') ⇒ Object
1567 1568 1569 1570 1571 1572 |
# File 'lib/rexle.rb', line 1567 def to_doc(root: 'root') recordset = self.map(&:to_a) Rexle.new([root,{}, *recordset]) end |
#xpath(xpath) ⇒ Object
1574 1575 1576 |
# File 'lib/rexle.rb', line 1574 def xpath(xpath) self.to_doc.root.xpath(xpath) end |