Class: VORuby::VOTables::VOTable::Type::ArrayDef
- Defined in:
- lib/voruby/votables/types.rb
Overview
A class representing a definition of an array size.
Constant Summary collapse
- @@pattern =
'^([0-9]+x)*[0-9]*[*]?(s\W)?$'
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(txt = nil) ⇒ ArrayDef
constructor
- txt:
-
The text of the array size definition.
- #to_s ⇒ Object
Constructor Details
#initialize(txt = nil) ⇒ ArrayDef
- txt:
-
The text of the array size definition. The allowed pattern is:
^([0-9]+x)*[0-9]*[*]?(s\W)?$
i.e. *, 64x64x10*, etc.
79 80 81 82 83 84 85 |
# File 'lib/voruby/votables/types.rb', line 79 def initialize(txt=nil) if txt and txt.match(@@pattern) @value = txt else raise "Array definition '#{txt}' does not match #{@@pattern}" end end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
72 73 74 |
# File 'lib/voruby/votables/types.rb', line 72 def value @value end |
Instance Method Details
#to_s ⇒ Object
87 88 89 |
# File 'lib/voruby/votables/types.rb', line 87 def to_s "{#{@value}}" end |