Class: VORuby::ADQL::V1_0::ExclusiveSearch

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

Overview

Represents SQL NOT IN expression

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from SerializableToXml

#element

Constructor Details

#initialize(expression, set) ⇒ ExclusiveSearch

Returns a new instance of ExclusiveSearch.



2203
2204
2205
2206
# File 'lib/voruby/adql/1.0/adql.rb', line 2203

def initialize(expression, set)
  self.expression = expression
  self.set = set
end

Instance Attribute Details

#expressionObject

Returns the value of attribute expression.



2199
2200
2201
# File 'lib/voruby/adql/1.0/adql.rb', line 2199

def expression
  @expression
end

#setObject

Returns the value of attribute set.



2199
2200
2201
# File 'lib/voruby/adql/1.0/adql.rb', line 2199

def set
  @set
end

Class Method Details

.from_xml(xml) ⇒ Object



2239
2240
2241
2242
2243
2244
2245
2246
# File 'lib/voruby/adql/1.0/adql.rb', line 2239

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

.xml_typeObject



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

def self.xml_type; 'exclusiveSearchType' end

Instance Method Details

#==(s) ⇒ Object



2220
2221
2222
2223
# File 'lib/voruby/adql/1.0/adql.rb', line 2220

def ==(s)
  self.expression == s.expression and
  self.set == s.set
end

#to_sObject



2225
2226
2227
# File 'lib/voruby/adql/1.0/adql.rb', line 2225

def to_s
  "#{expression} NOT IN #{set}"
end

#to_xml(name = nil) ⇒ Object



2229
2230
2231
2232
2233
2234
2235
2236
2237
# File 'lib/voruby/adql/1.0/adql.rb', line 2229

def to_xml(name=nil)
  el = super(name)
  
  el.add_element(self.expression.to_xml('Expression'))
  el.add_element(self.set.to_xml('Set'))
  
  collapse_namespaces(el)
  el
end