Class: VORuby::ADQL::V1_0::Literal

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

Overview

The base type for all literals

Direct Known Subclasses

NumberLiteral, StringLiteral

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from SerializableToXml

#element

Constructor Details

#initialize(v) ⇒ Literal

Returns a new instance of Literal.



266
267
268
# File 'lib/voruby/adql/1.0/adql.rb', line 266

def initialize(v)
  self.value = v
end

Instance Attribute Details

#valueObject

Returns the value of attribute value.



264
265
266
# File 'lib/voruby/adql/1.0/adql.rb', line 264

def value
  @value
end

Instance Method Details

#==(l) ⇒ Object



274
275
276
# File 'lib/voruby/adql/1.0/adql.rb', line 274

def ==(l)
  self.value == l.value
end

#to_sObject



278
279
280
# File 'lib/voruby/adql/1.0/adql.rb', line 278

def to_s
  self.value.to_s
end

#to_xml(name = nil) ⇒ Object



282
283
284
285
286
# File 'lib/voruby/adql/1.0/adql.rb', line 282

def to_xml(name=nil)
  el = element_root(name)
  el.attributes["#{obj_ns.prefix}:Value"] = self.value.to_s
  el
end