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.



1600
1601
1602
# File 'lib/rexle.rb', line 1600

def initialize(a)
  super(a)
end

Instance Method Details

#element(xpath) ⇒ Object



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

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

#to_doc(root: 'root') ⇒ Object



1604
1605
1606
1607
1608
1609
# File 'lib/rexle.rb', line 1604

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

end

#xpath(xpath) ⇒ Object



1611
1612
1613
# File 'lib/rexle.rb', line 1611

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