Class: VORuby::ADQL::V1_0::RealLiteral

Inherits:
NumberLiteral show all
Defined in:
lib/voruby/adql/1.0/adql.rb

Overview

Represents a real number

Instance Attribute Summary

Attributes inherited from Literal

#value

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Literal

#==, #initialize, #to_s, #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



301
302
303
304
305
306
# File 'lib/voruby/adql/1.0/adql.rb', line 301

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

.xml_typeObject



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

def self.xml_type; 'realType' end

Instance Method Details

#value=(v) ⇒ Object



296
297
298
299
# File 'lib/voruby/adql/1.0/adql.rb', line 296

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