Class: VORuby::STC::V1_30::FkType

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

Overview

FK type: needs an equinox

Direct Known Subclasses

ECLIPTIC, FK4, FK5

Instance Attribute Summary collapse

Attributes inherited from CoordRefFrameType

#name, #ref_frame_id

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from SpaceRefFrameType

space_ref_frame_from_xml

Methods inherited from CoordRefFrameType

coord_ref_frame_from_xml

Methods included from SerializableToXml

#element

Constructor Details

#initialize(equinox, ref_frame_id, name = nil) ⇒ FkType

Returns a new instance of FkType.



6491
6492
6493
6494
# File 'lib/voruby/stc/1.30/stc.rb', line 6491

def initialize(equinox, ref_frame_id, name=nil)
  super(ref_frame_id, name)
  self.equinox = equinox
end

Instance Attribute Details

#equinoxObject

Returns the value of attribute equinox.



6489
6490
6491
# File 'lib/voruby/stc/1.30/stc.rb', line 6489

def equinox
  @equinox
end

Class Method Details

.from_xml(xml) ⇒ Object



6520
6521
6522
6523
6524
6525
6526
6527
6528
# File 'lib/voruby/stc/1.30/stc.rb', line 6520

def self.from_xml(xml)
  root = element_from(xml)
  
  name = REXML::XPath.first(root, 'x:Name', {'x' => obj_ns.uri})
  self.new(
    CoordEquinoxType.new(REXML::XPath.first(root, 'x:Equinox', {'x' => obj_ns.uri}).text),
    *SpaceRefFrameType.space_ref_frame_from_xml(root)
  )
end

Instance Method Details

#==(f) ⇒ Object



6505
6506
6507
6508
# File 'lib/voruby/stc/1.30/stc.rb', line 6505

def ==(f)
  super(f) and
  self.equinox == f.equinox
end

#to_xml(name = nil) ⇒ Object



6510
6511
6512
6513
6514
6515
6516
6517
6518
# File 'lib/voruby/stc/1.30/stc.rb', line 6510

def to_xml(name=nil)
  el = super(name)
  
  equinox_el = REXML::Element.new("#{obj_ns.prefix}:Equinox")
  equinox_el.text = self.equinox.to_s
  el.add_element(equinox_el)
  
  el
end