Class: VORuby::VOTables::VOTable::Type::StreamType
- Defined in:
- lib/voruby/votables/types.rb
Overview
A class representing a type of stream.
Constant Summary collapse
- @@types =
['locator', 'other']
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(txt = nil) ⇒ StreamType
constructor
- txt:
-
The stream type.
- #to_s ⇒ Object
Constructor Details
#initialize(txt = nil) ⇒ StreamType
- txt:
-
The stream type. Choices: locator, other.
251 252 253 254 255 256 257 258 |
# File 'lib/voruby/votables/types.rb', line 251 def initialize(txt=nil) if txt and @@types.include?(txt) @value = txt else raise "Stream type '#{txt}' is not valid. Use one of: " + @@types.join(', ') end end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
246 247 248 |
# File 'lib/voruby/votables/types.rb', line 246 def value @value end |
Instance Method Details
#to_s ⇒ Object
260 261 262 |
# File 'lib/voruby/votables/types.rb', line 260 def to_s "{#{@value}}" end |