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.



1550
1551
1552
# File 'lib/rexle.rb', line 1550

def initialize(a)
  super(a)
end

Instance Method Details

#element(xpath) ⇒ Object



1565
1566
1567
# File 'lib/rexle.rb', line 1565

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

#to_doc(root: 'root') ⇒ Object



1554
1555
1556
1557
1558
1559
# File 'lib/rexle.rb', line 1554

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

end

#xpath(xpath) ⇒ Object



1561
1562
1563
# File 'lib/rexle.rb', line 1561

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