Class: VORuby::VOTable::V1_0::TableData

Inherits:
Base show all
Defined in:
lib/voruby/votable/1.0/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])


1464
1465
1466
# File 'lib/voruby/votable/1.0/votable.rb', line 1464

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

Instance Method Details

#trsObject

Retrieve the rows of data. Returns a HomogeneousNodeList.



1470
1471
1472
# File 'lib/voruby/votable/1.0/votable.rb', line 1470

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

#trs=(rows) ⇒ Object

Set the rows of data.

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


1476
1477
1478
# File 'lib/voruby/votable/1.0/votable.rb', line 1476

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