Class: VORuby::ADQL::V1_0::StringLiteral

Inherits:
Literal
  • Object
show all
Defined in:
lib/voruby/adql/1.0/adql.rb

Overview

Represents a string literal

Instance Attribute Summary

Attributes inherited from Literal

#value

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Literal

#==, #initialize, #to_xml

Methods included from SerializableToXml

#element

Constructor Details

This class inherits a constructor from VORuby::ADQL::V1_0::Literal

Class Method Details

.from_xml(xml) ⇒ Object



339
340
341
342
343
344
# File 'lib/voruby/adql/1.0/adql.rb', line 339

def self.from_xml(xml)
  root = element_from(xml)
  self.new(
    root.attributes.get_attribute_ns(obj_ns.uri, 'Value').value
  )
end

.xml_typeObject



328
# File 'lib/voruby/adql/1.0/adql.rb', line 328

def self.xml_type; 'stringType' end

Instance Method Details

#to_sObject



335
336
337
# File 'lib/voruby/adql/1.0/adql.rb', line 335

def to_s
  "'#{super}'"
end

#value=(v) ⇒ Object



330
331
332
333
# File 'lib/voruby/adql/1.0/adql.rb', line 330

def value=(v)
  raise_argument_required_error('value') if v == nil
  super(v.to_s)
end