Class: VORuby::STC::V1_30::AstroCoordsType
- Inherits:
-
CoordsType
- Object
- STCBaseType
- CoordsType
- VORuby::STC::V1_30::AstroCoordsType
- Defined in:
- lib/voruby/stc/1.30/stc.rb
Overview
The astronomical (STC) coordsType.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#coord_file ⇒ Object
Returns the value of attribute coord_file.
-
#orbit ⇒ Object
Returns the value of attribute orbit.
-
#position ⇒ Object
Returns the value of attribute position.
-
#redshift ⇒ Object
Returns the value of attribute redshift.
-
#spectral ⇒ Object
Returns the value of attribute spectral.
-
#time ⇒ Object
Returns the value of attribute time.
-
#velocity ⇒ Object
Returns the value of attribute velocity.
Attributes inherited from CoordsType
#coord_system_id, #coordinates
Attributes included from STCReference
#id, #idref, #ucd, #xlink_href, #xlink_type
Class Method Summary collapse
Instance Method Summary collapse
- #==(c) ⇒ Object
-
#initialize(coord_system_id, coordinates, options = {}) ⇒ AstroCoordsType
constructor
A new instance of AstroCoordsType.
- #to_xml(name = nil) ⇒ Object
Methods inherited from CoordsType
Methods inherited from STCBaseType
Methods included from STCReference
#stc_reference_eq, stc_reference_from_xml, #stc_reference_to_xml
Methods included from SerializableToXml
Constructor Details
#initialize(coord_system_id, coordinates, options = {}) ⇒ AstroCoordsType
Returns a new instance of AstroCoordsType.
3544 3545 3546 |
# File 'lib/voruby/stc/1.30/stc.rb', line 3544 def initialize(coord_system_id, coordinates, ={}) super(coord_system_id, coordinates, ) end |
Instance Attribute Details
#coord_file ⇒ Object
Returns the value of attribute coord_file.
3541 3542 3543 |
# File 'lib/voruby/stc/1.30/stc.rb', line 3541 def coord_file @coord_file end |
#orbit ⇒ Object
Returns the value of attribute orbit.
3541 3542 3543 |
# File 'lib/voruby/stc/1.30/stc.rb', line 3541 def orbit @orbit end |
#position ⇒ Object
Returns the value of attribute position.
3541 3542 3543 |
# File 'lib/voruby/stc/1.30/stc.rb', line 3541 def position @position end |
#redshift ⇒ Object
Returns the value of attribute redshift.
3541 3542 3543 |
# File 'lib/voruby/stc/1.30/stc.rb', line 3541 def redshift @redshift end |
#spectral ⇒ Object
Returns the value of attribute spectral.
3541 3542 3543 |
# File 'lib/voruby/stc/1.30/stc.rb', line 3541 def spectral @spectral end |
#time ⇒ Object
Returns the value of attribute time.
3541 3542 3543 |
# File 'lib/voruby/stc/1.30/stc.rb', line 3541 def time @time end |
#velocity ⇒ Object
Returns the value of attribute velocity.
3541 3542 3543 |
# File 'lib/voruby/stc/1.30/stc.rb', line 3541 def velocity @velocity end |
Class Method Details
.from_xml(xml) ⇒ Object
3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 |
# File 'lib/voruby/stc/1.30/stc.rb', line 3611 def self.from_xml(xml) root = element_from(xml) csi, coordinates, = CoordsType.coords_from_xml(root) [:time] = xml_to_obj(root, Time, true) [:position] = xml_to_obj(root, Position, true) [:velocity] = xml_to_obj(root, Velocity, true) [:spectral] = xml_to_obj(root, Spectral, true) [:redshift] = xml_to_obj(root, Redshift, true) cfile = REXML::XPath.first(root, 'x:CoordFile', {'x' => obj_ns.uri}) [:coord_file] = AstroCoordsFileType.from_xml(cfile) if cfile orbit = REXML::XPath.first(root, 'x:Orbit', {'x' => obj_ns.uri}) [:orbit] = OrbitType.from_xml(orbit) if orbit self.new(csi, coordinates, ) end |
Instance Method Details
#==(c) ⇒ Object
3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 |
# File 'lib/voruby/stc/1.30/stc.rb', line 3585 def ==(c) super(c) and self.time == c.time and self.position == c.position and self.velocity == c.velocity and self.spectral == c.spectral and self.redshift == c.redshift and self.coord_file == c.coord_file and self.orbit == c.orbit end |
#to_xml(name = nil) ⇒ Object
3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 |
# File 'lib/voruby/stc/1.30/stc.rb', line 3596 def to_xml(name=nil) el = super(name) el.add_element(self.time.to_xml) if self.time el.add_element(self.position.to_xml) if self.position el.add_element(self.velocity.to_xml) if self.velocity el.add_element(self.spectral.to_xml) if self.spectral el.add_element(self.redshift.to_xml) if self.redshift el.add_element(self.coord_file.to_xml('CoordFile')) if self.coord_file el.add_element(self.orbit.to_xml('Orbit')) if self.orbit collapse_namespaces(el) el end |