Class: VORuby::VOTables::VOTable::Type::EncodingType

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

Overview

A class representing the encoding method of a document.

Constant Summary collapse

@@types =
['gzip', 'base64', 'dynamic', 'none']

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(txt = nil) ⇒ EncodingType

txt:

The encoding type. Choices: gzip, base64, dynamic, none.



99
100
101
102
103
104
105
106
107
# File 'lib/voruby/votables/types.rb', line 99

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



94
95
96
# File 'lib/voruby/votables/types.rb', line 94

def value
  @value
end

Instance Method Details

#to_sObject



109
110
111
# File 'lib/voruby/votables/types.rb', line 109

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