Class: VORuby::VOEvent::V1_1::WhereWhen
- Defined in:
- lib/voruby/voevent/1.1/voevent.rb
Overview
Space-Time Coordinates, uses the VO STC schema.
Defined Under Namespace
Classes: ObsDataLocationList
Instance Attribute Summary collapse
-
#obs_data_locations ⇒ Object
Returns the value of attribute obs_data_locations.
Attributes inherited from Described
Class Method Summary collapse
Instance Method Summary collapse
- #==(w) ⇒ Object
-
#initialize(obs_data_locations = nil, descriptions = nil, references = nil) ⇒ WhereWhen
constructor
A new instance of WhereWhen.
- #to_xml(name = nil) ⇒ Object
Methods inherited from Described
Methods included from SerializableToXml
Constructor Details
#initialize(obs_data_locations = nil, descriptions = nil, references = nil) ⇒ WhereWhen
Returns a new instance of WhereWhen.
498 499 500 501 |
# File 'lib/voruby/voevent/1.1/voevent.rb', line 498 def initialize(obs_data_locations=nil, descriptions=nil, references=nil) super(descriptions, references) self.obs_data_locations = obs_data_locations end |
Instance Attribute Details
#obs_data_locations ⇒ Object
Returns the value of attribute obs_data_locations.
496 497 498 |
# File 'lib/voruby/voevent/1.1/voevent.rb', line 496 def obs_data_locations @obs_data_locations end |
Class Method Details
.from_xml(xml) ⇒ Object
526 527 528 529 530 531 532 533 534 535 536 |
# File 'lib/voruby/voevent/1.1/voevent.rb', line 526 def self.from_xml(xml) root = element_from(xml) locs = REXML::XPath.match(root, 'x:ObsDataLocation', {'x' => obj_ns('VORuby::STC::V1_30').uri}) locs = nil if locs.size == 0 self.new( locs ? ObsDataLocationList.new(locs.collect{ |l| ObsDataLocation.from_xml(l) }) : nil, *Described.described_from_xml(root) ) end |
Instance Method Details
#==(w) ⇒ Object
512 513 514 515 |
# File 'lib/voruby/voevent/1.1/voevent.rb', line 512 def ==(w) super(w) and self.obs_data_locations == w.obs_data_locations end |
#to_xml(name = nil) ⇒ Object
517 518 519 520 521 522 523 524 |
# File 'lib/voruby/voevent/1.1/voevent.rb', line 517 def to_xml(name=nil) el = super(name) self.obs_data_locations.each{ |l| el.add_element(l.to_xml) } if self.obs_data_locations collapse_namespaces(el) el end |