Class: VORuby::VOTables::VOTable::Type::ResourceType
- Defined in:
- lib/voruby/votables/types.rb
Overview
A class representing a resource type.
Constant Summary collapse
- @@types =
['results', 'meta']
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(txt = nil) ⇒ ResourceType
constructor
- txt:
-
The type of resource.
- #to_s ⇒ Object
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
#value ⇒ Object (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_s ⇒ Object
361 362 363 |
# File 'lib/voruby/votables/types.rb', line 361 def to_s "{#{@value}}" end |