Class: VORuby::VOTables::VOTable::Type::ValuesType

Inherits:
Object
  • Object
show all
Defined in:
lib/voruby/votables/types.rb

Overview

A class representing a values type.

Constant Summary collapse

@@types =
['legal', 'actual']

Instance Attribute Summary collapse

Instance Method Summary collapse

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

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



340
341
342
# File 'lib/voruby/votables/types.rb', line 340

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