Class: VORuby::VOTables::VOTable::Type::EncodingType
- 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
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(txt = nil) ⇒ EncodingType
constructor
- txt:
-
The encoding type.
- #to_s ⇒ Object
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
#value ⇒ Object (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_s ⇒ Object
109 110 111 |
# File 'lib/voruby/votables/types.rb', line 109 def to_s "{#{@value}}" end |