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.



1608
1609
1610
# File 'lib/rexle.rb', line 1608

def initialize(a)
  super(a)
end

Instance Method Details

#element(xpath) ⇒ Object



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

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

#to_doc(root: 'root') ⇒ Object



1612
1613
1614
1615
1616
1617
# File 'lib/rexle.rb', line 1612

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

end

#xpath(xpath) ⇒ Object



1619
1620
1621
# File 'lib/rexle.rb', line 1619

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