Class: VORuby::VOTables::VOTable::Type::ResourceType

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

Overview

A class representing a resource type.

Constant Summary collapse

@@types =
['results', 'meta']

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(txt = nil) ⇒ ResourceType

txt:

The type of resource. Choices: results, meta.



352
353
354
355
356
357
358
359
# File 'lib/voruby/votables/types.rb', line 352

def initialize(txt=nil)
if txt and @@types.include?(txt)
 @value = txt
else
 raise "Resource type '#{txt}' is not valid.  Use one of: " +
	  @@types.join(', ')
end
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



347
348
349
# File 'lib/voruby/votables/types.rb', line 347

def value
  @value
end

Instance Method Details

#to_sObject



361
362
363
# File 'lib/voruby/votables/types.rb', line 361

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