Class: VORuby::VOTable::V1_1::TableData

Inherits:
Base show all
Defined in:
lib/voruby/votable/1.1/votable.rb

Overview

The most typical way of representing tabular data.

Constant Summary collapse

ELEMENT_NAME =
'TABLEDATA'

Instance Attribute Summary

Attributes inherited from XML::Object::Base

#node

Instance Method Summary collapse

Methods inherited from Base

#==, element_name, #get_element, #xpath_for

Methods inherited from XML::Object::Base

#==, element_name, from_file, #to_s

Constructor Details

#initialize(defn = nil) ⇒ TableData

Create new table data.

tabledata = TableData.new(:trs => [Tr.new, Tr.new, Tr.new])


1752
1753
1754
# File 'lib/voruby/votable/1.1/votable.rb', line 1752

def initialize(defn=nil)
  super(defn)
end

Instance Method Details

#trsObject

Retrieve the rows of data. Returns a HomogeneousNodeList.



1758
1759
1760
# File 'lib/voruby/votable/1.1/votable.rb', line 1758

def trs
  HomogeneousNodeList.new(self.node, xpath_for(Tr), Tr)
end

#trs=(rows) ⇒ Object

Set the rows of data.

tabledata.rows = [Tr.new(), ...]


1764
1765
1766
# File 'lib/voruby/votable/1.1/votable.rb', line 1764

def trs=(rows)
  self.trs.replace(rows)
end