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.



1597
1598
1599
# File 'lib/rexle.rb', line 1597

def initialize(a)
  super(a)
end

Instance Method Details

#element(xpath) ⇒ Object



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

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

#to_doc(root: 'root') ⇒ Object



1601
1602
1603
1604
1605
1606
# File 'lib/rexle.rb', line 1601

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

end

#xpath(xpath) ⇒ Object



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

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