Class: VORuby::STC::V1_30::PosUnitType

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

Overview

Spatial coordinate units may be angular (degrees, radians, hours, arcmins, arcsecs), linear (meters, km, mm, AUs, parsecs, kpc, Mpc, lightyears), or empty (i.e., dimensionless). The three-units strings are for special 3-D vectors where the components do not share the same unit; one may prefer to give each component its own unit, instead.

Instance Attribute Summary

Attributes inherited from Enumeration

#choices, #value

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Enumeration

#==, #to_s

Constructor Details

#initialize(u = '') ⇒ PosUnitType

Returns a new instance of PosUnitType.



39
40
41
42
# File 'lib/voruby/stc/1.30/stc.rb', line 39

def initialize(u='')
  u ||= ''
  super(u.to_s)
end

Class Method Details

.choicesObject



31
32
33
34
35
36
37
# File 'lib/voruby/stc/1.30/stc.rb', line 31

def self.choices
  [
    'deg', 'deg deg m', 'deg deg Mpc', 'rad', 'h',
    'arcmin', 'arcsec', 'm', 'km', 'mm', 'AU', 'pc',
    'kpc', 'Mpc', 'lyr', ''
  ]
end