Class: VORuby::VOTables::VOTable::Type::FieldType
- Defined in:
- lib/voruby/votables/types.rb
Overview
A class representing a field type.
Constant Summary collapse
- @@types =
['hidden', 'no_query', 'trigger', 'location']
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(txt = nil) ⇒ FieldType
constructor
- txt:
-
The field type.
- #to_s ⇒ Object
Constructor Details
#initialize(txt = nil) ⇒ FieldType
- txt:
-
The field type. Choices: hidden, no_query, trigger, location.
373 374 375 376 377 378 379 380 |
# File 'lib/voruby/votables/types.rb', line 373 def initialize(txt=nil) if txt and @@types.include?(txt) @value = txt else raise "Field type '#{txt}' is not valid. Use one of: " + @@types.join(', ') end end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
368 369 370 |
# File 'lib/voruby/votables/types.rb', line 368 def value @value end |
Instance Method Details
#to_s ⇒ Object
382 383 384 |
# File 'lib/voruby/votables/types.rb', line 382 def to_s "{#{@value}}" end |