Class: VORuby::ADQL::V1_0::ClosedExpr

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

Overview

Represents an expression inside a bracket

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from SerializableToXml

#element

Constructor Details

#initialize(a) ⇒ ClosedExpr

Returns a new instance of ClosedExpr.



32
33
34
35
# File 'lib/voruby/adql/1.0/adql.rb', line 32

def initialize(a)
  super()
  self.arg = a
end

Instance Attribute Details

#argObject

Returns the value of attribute arg.



28
29
30
# File 'lib/voruby/adql/1.0/adql.rb', line 28

def arg
  @arg
end

Class Method Details

.from_xml(xml) ⇒ Object



59
60
61
62
63
64
65
# File 'lib/voruby/adql/1.0/adql.rb', line 59

def self.from_xml(xml)
  root = element_from(xml)
  
  self.new(
    xml_to_obj(REXML::XPath.first(root, 'x:Arg', {'x' => obj_ns.uri}))
  )
end

.xml_typeObject



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

def self.xml_type; 'closedExprType' end

Instance Method Details

#==(e) ⇒ Object



55
56
57
# File 'lib/voruby/adql/1.0/adql.rb', line 55

def ==(e)
  self.arg == e.arg
end

#to_sObject



51
52
53
# File 'lib/voruby/adql/1.0/adql.rb', line 51

def to_s
  "(#{self.arg})"
end

#to_xml(name = nil) ⇒ Object



43
44
45
46
47
48
49
# File 'lib/voruby/adql/1.0/adql.rb', line 43

def to_xml(name=nil)
  el = super(name)
  el.add_element(self.arg.to_xml('Arg'))
  
  collapse_namespaces(el)
  el
end