Class: VORuby::ADQL::LiteralType

Inherits:
Object
  • Object
show all
Defined in:
lib/voruby/adql/adql.rb,
lib/voruby/adql/transforms.rb

Overview

The base type for all literals.

Direct Known Subclasses

NumberType, StringType

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_xml(node) ⇒ Object



347
348
349
350
351
352
# File 'lib/voruby/adql/adql.rb', line 347

def self.from_xml(node)
  #type_s = node.attributes['xsi:type']
  type_s = node.find_attribute('type', 'http://www.w3.org/2001/XMLSchema-instance')
  literal = ObjectBuilder.get_class_for(type_s).from_xml(node)
  return literal
end

Instance Method Details

#to_adqlsObject



83
84
85
# File 'lib/voruby/adql/transforms.rb', line 83

def to_adqls
	self.value.to_s
end

#to_adqlx(literal_type) ⇒ Object



87
88
89
# File 'lib/voruby/adql/transforms.rb', line 87

def to_adqlx(literal_type)
  "<Literal xsi:type=\"#{literal_type}\" Value=\"#{self.value.to_s}\" />"
end

#to_sObject



343
344
345
# File 'lib/voruby/adql/adql.rb', line 343

def to_s
	"{value=#{self.value}}"
end