Class: Rexle::Recordset

Inherits:
Array
  • Object
show all
Defined in:
lib/rexle.rb

Instance Method Summary collapse

Constructor Details

#initialize(a) ⇒ Recordset

Returns a new instance of Recordset.



1634
1635
1636
# File 'lib/rexle.rb', line 1634

def initialize(a)
  super(a)
end

Instance Method Details

#element(xpath) ⇒ Object



1649
1650
1651
# File 'lib/rexle.rb', line 1649

def element(xpath)
  self.to_doc.root.element(xpath)
end

#to_doc(root: 'root') ⇒ Object



1638
1639
1640
1641
1642
1643
# File 'lib/rexle.rb', line 1638

def to_doc(root: 'root')

  recordset = self.map(&:to_a)
  Rexle.new([root,{}, *recordset])

end

#xpath(xpath) ⇒ Object



1645
1646
1647
# File 'lib/rexle.rb', line 1645

def xpath(xpath)
  self.to_doc.root.xpath(xpath)
end