Class: VORuby::VOTables::VOTable::Type::StreamType

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#valueObject (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_sObject



260
261
262
# File 'lib/voruby/votables/types.rb', line 260

def to_s
 "{#{@value}}"
end