Class: VORuby::VOTables::VOTable::Data::TableData

Inherits:
Object
  • Object
show all
Defined in:
lib/voruby/votables/data.rb,
lib/voruby/votables/transforms.rb,
lib/voruby/votables/rexml_parser.rb,
lib/voruby/votables/libxml_parser.rb

Overview

A class representing the VOTable standard TABLEDATA element.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(trs = []) ⇒ TableData

trs:

A list of rows associated with the table in question.



139
140
141
142
143
144
# File 'lib/voruby/votables/data.rb', line 139

def initialize(trs=[])
trs.each{ |tr|
 Misc::TypeCheck.new(tr, TR).check()
}
@trs = trs
end

Instance Attribute Details

#trsObject (readonly)

Returns the value of attribute trs.



135
136
137
# File 'lib/voruby/votables/data.rb', line 135

def trs
  @trs
end

Class Method Details

.from_soap_obj(mtbldata) ⇒ Object



346
347
348
349
350
# File 'lib/voruby/votables/transforms.rb', line 346

def self.from_soap_obj(mtbldata)
  TableData.new(
     (mtbldata.respond_to?(:tR))? TR.from_soap_obj(mtbldata.tR): []
   )        
end

.from_xml(node) ⇒ Object



375
376
377
378
379
380
381
382
# File 'lib/voruby/votables/rexml_parser.rb', line 375

def self.from_xml(node)
trs = []
node.elements.each('TR'){ |trNode|
 		trs.push(TR.from_xml(trNode))
}
	
return self.new(trs)
end

Instance Method Details

#to_sObject



146
147
148
149
# File 'lib/voruby/votables/data.rb', line 146

def to_s
trs = @trs.collect{|x| x.to_s}.join('|')
"{trs=#{trs}}"
end