Class: VORuby::VOTables::VOTable::Type::UCDType

Inherits:
Object
  • Object
show all
Defined in:
lib/voruby/votables/types.rb

Overview

A class representing a UCD, including UCD1+.

Constant Summary collapse

@@pattern =
'^[A-Za-z0-9_.:;\-]*$'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(txt = nil) ⇒ UCDType

txt:

A UCD. The allowed pattern is:

^[A-Za-z0-9_.:;\-]*$

i.e. phot.mag;em.opt.V, PHOT_JHN_V etc.



57
58
59
60
61
62
63
# File 'lib/voruby/votables/types.rb', line 57

def initialize(txt=nil)
if txt and txt.match(@@pattern)
 @value = txt
else
 raise "UCD type '#{txt}' does not match #{@@pattern}"
end
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



50
51
52
# File 'lib/voruby/votables/types.rb', line 50

def value
  @value
end

Instance Method Details

#to_sObject



65
66
67
# File 'lib/voruby/votables/types.rb', line 65

def to_s
"{#{@value}}"
end