Class: VORuby::VOTables::VOTable::Type::UCDType
- 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
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(txt = nil) ⇒ UCDType
constructor
- txt:
-
A UCD.
- #to_s ⇒ Object
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
#value ⇒ Object (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_s ⇒ Object
65 66 67 |
# File 'lib/voruby/votables/types.rb', line 65 def to_s "{#{@value}}" end |