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.



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

def initialize(a)
  super(a)
end

Instance Method Details

#element(xpath) ⇒ Object



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

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

#to_doc(root: 'root') ⇒ Object



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

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

end

#xpath(xpath) ⇒ Object



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

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