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.



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

def initialize(a)
  super(a)
end

Instance Method Details

#element(xpath) ⇒ Object



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

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

#to_doc(root: 'root') ⇒ Object



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

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

end

#xpath(xpath) ⇒ Object



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

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