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.



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

def initialize(a)
  super(a)
end

Instance Method Details

#element(xpath) ⇒ Object



1592
1593
1594
# File 'lib/rexle.rb', line 1592

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

#to_doc(root: 'root') ⇒ Object



1581
1582
1583
1584
1585
1586
# File 'lib/rexle.rb', line 1581

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

end

#xpath(xpath) ⇒ Object



1588
1589
1590
# File 'lib/rexle.rb', line 1588

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