Class: VORuby::VOTables::VOTable::Type::FieldType

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

Instance Method Summary collapse

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

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



382
383
384
# File 'lib/voruby/votables/types.rb', line 382

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