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.



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

def initialize(a)
  super(a)
end

Instance Method Details

#element(xpath) ⇒ Object



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

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

#to_doc(root: 'root') ⇒ Object



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

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

end

#xpath(xpath) ⇒ Object



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

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