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.



1622
1623
1624
# File 'lib/rexle.rb', line 1622

def initialize(a)
  super(a)
end

Instance Method Details

#element(xpath) ⇒ Object



1637
1638
1639
# File 'lib/rexle.rb', line 1637

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

#to_doc(root: 'root') ⇒ Object



1626
1627
1628
1629
1630
1631
# File 'lib/rexle.rb', line 1626

def to_doc(root: 'root')

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

end

#xpath(xpath) ⇒ Object



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

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