Class: VORuby::VOTables::VOTable::Type::ValuesType
- Defined in:
- lib/voruby/votables/types.rb
Overview
A class representing a values type.
Constant Summary collapse
- @@types =
['legal', 'actual']
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(txt = nil) ⇒ ValuesType
constructor
- txt:
-
The type of values.
- #to_s ⇒ Object
Constructor Details
#initialize(txt = nil) ⇒ ValuesType
- txt:
-
The type of values. Choices: legal, actual.
331 332 333 334 335 336 337 338 |
# File 'lib/voruby/votables/types.rb', line 331 def initialize(txt=nil) if txt and @@types.include?(txt) @value = txt else raise "Values type '#{txt}' is not valid. Use one of: " + @@types.join(', ') end end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
326 327 328 |
# File 'lib/voruby/votables/types.rb', line 326 def value @value end |
Instance Method Details
#to_s ⇒ Object
340 341 342 |
# File 'lib/voruby/votables/types.rb', line 340 def to_s "{#{@value}}" end |