Class: VORuby::VOTables::VOTable::Data::TR

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 TR element.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tds = []) ⇒ TR

tds:

A list of table data belonging in the row in question.



120
121
122
123
124
125
# File 'lib/voruby/votables/data.rb', line 120

def initialize(tds=[])
tds.each{ |td|
 Misc::TypeCheck.new(td, TD).check()
}
    		@tds = tds
end

Instance Attribute Details

#tdsObject (readonly)

Returns the value of attribute tds.



116
117
118
# File 'lib/voruby/votables/data.rb', line 116

def tds
  @tds
end

Class Method Details

.from_soap_obj(mtrs) ⇒ Object



354
355
356
357
358
359
360
361
362
363
364
365
# File 'lib/voruby/votables/transforms.rb', line 354

def self.from_soap_obj(mtrs)
  mtrs = [mtrs] if !mtrs.respond_to?(:each)

  trs = []
  mtrs.each do |tr|
    trs.push(
      (tr.respond_to?(:tD))? TR.new(TD.from_soap_obj(tr.tD)): []
    )
  end

  trs
end

.from_xml(node) ⇒ Object



364
365
366
367
368
369
370
371
# File 'lib/voruby/votables/rexml_parser.rb', line 364

def self.from_xml(node)
 tds = []
	node.elements.each('TD'){ |tdNode|
 			tds.push(TD.from_xml(tdNode))
	}
	
	return self.new(tds)
end

Instance Method Details

#to_sObject



127
128
129
130
# File 'lib/voruby/votables/data.rb', line 127

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