Class: Rexle::Recordset

Inherits:
Array
  • Object
show all
Defined in:
lib/rexle.rb

Instance Method Summary collapse

Constructor Details

#initialize(a) ⇒ Recordset



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

def initialize(a)
  super(a)
end

Instance Method Details

#element(xpath) ⇒ Object



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

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

#to_doc(root: 'root') ⇒ Object



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

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

end

#xpath(xpath) ⇒ Object



1571
1572
1573
# File 'lib/rexle.rb', line 1571

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