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.
1574 1575 1576 |
# File 'lib/rexle.rb', line 1574 def initialize(a) super(a) end |
Instance Method Details
#element(xpath) ⇒ Object
1589 1590 1591 |
# File 'lib/rexle.rb', line 1589 def element(xpath) self.to_doc.root.element(xpath) end |
#to_doc(root: 'root') ⇒ Object
1578 1579 1580 1581 1582 1583 |
# File 'lib/rexle.rb', line 1578 def to_doc(root: 'root') recordset = self.map(&:to_a) Rexle.new([root,{}, *recordset]) end |
#xpath(xpath) ⇒ Object
1585 1586 1587 |
# File 'lib/rexle.rb', line 1585 def xpath(xpath) self.to_doc.root.xpath(xpath) end |