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.



1563
1564
1565
# File 'lib/rexle.rb', line 1563

def initialize(a)
  super(a)
end

Instance Method Details

#element(xpath) ⇒ Object



1578
1579
1580
# File 'lib/rexle.rb', line 1578

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

#to_doc(root: 'root') ⇒ Object



1567
1568
1569
1570
1571
1572
# File 'lib/rexle.rb', line 1567

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

end

#xpath(xpath) ⇒ Object



1574
1575
1576
# File 'lib/rexle.rb', line 1574

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