Class: VORuby::STC::V1_30::StdRefPosType

Inherits:
ReferencePositionType show all
Defined in:
lib/voruby/stc/1.30/stc.rb

Overview

Type for standard reference positions.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from SerializableToXml

#element

Constructor Details

#initialize(planetary_ephem = nil) ⇒ StdRefPosType

Returns a new instance of StdRefPosType.



7222
7223
7224
# File 'lib/voruby/stc/1.30/stc.rb', line 7222

def initialize(planetary_ephem=nil)
  self.planetary_ephem = planetary_ephem
end

Instance Attribute Details

#planetary_ephemObject

Returns the value of attribute planetary_ephem.



7220
7221
7222
# File 'lib/voruby/stc/1.30/stc.rb', line 7220

def planetary_ephem
  @planetary_ephem
end

Class Method Details

.from_xml(xml) ⇒ Object



7250
7251
7252
7253
7254
# File 'lib/voruby/stc/1.30/stc.rb', line 7250

def self.from_xml(xml)
  root = element_from(xml)
  pe = REXML::XPath.first(root, 'x:PlanetaryEphem', {'x' => obj_ns.uri})
  self.new(pe ? PlanetaryEphemType.new(pe.text) : nil)
end

Instance Method Details

#==(r) ⇒ Object



7234
7235
7236
# File 'lib/voruby/stc/1.30/stc.rb', line 7234

def ==(r)
  self.planetary_ephem == r.planetary_ephem
end

#to_xml(name = nil) ⇒ Object



7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
# File 'lib/voruby/stc/1.30/stc.rb', line 7238

def to_xml(name=nil)
  el = element(name)
  
  if self.planetary_ephem
    pe_el = REXML::Element.new("#{obj_ns.prefix}:PlanetaryEphem")
    pe_el.text = self.planetary_ephem.to_s
    el.add_element(pe_el)
  end
  
  el
end