Class: VORuby::ADQL::V1_0::InclusiveSearch

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

Overview

Represents SQL IN expression

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from SerializableToXml

#element

Constructor Details

#initialize(expression, set) ⇒ InclusiveSearch

Returns a new instance of InclusiveSearch.



2151
2152
2153
2154
# File 'lib/voruby/adql/1.0/adql.rb', line 2151

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

Instance Attribute Details

#expressionObject

Returns the value of attribute expression.



2147
2148
2149
# File 'lib/voruby/adql/1.0/adql.rb', line 2147

def expression
  @expression
end

#setObject

Returns the value of attribute set.



2147
2148
2149
# File 'lib/voruby/adql/1.0/adql.rb', line 2147

def set
  @set
end

Class Method Details

.from_xml(xml) ⇒ Object



2187
2188
2189
2190
2191
2192
2193
2194
# File 'lib/voruby/adql/1.0/adql.rb', line 2187

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



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

def self.xml_type; 'inclusiveSearchType' end

Instance Method Details

#==(s) ⇒ Object



2168
2169
2170
2171
# File 'lib/voruby/adql/1.0/adql.rb', line 2168

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

#to_sObject



2173
2174
2175
# File 'lib/voruby/adql/1.0/adql.rb', line 2173

def to_s
  "#{self.expression} IN #{self.set}"
end

#to_xml(name = nil) ⇒ Object



2177
2178
2179
2180
2181
2182
2183
2184
2185
# File 'lib/voruby/adql/1.0/adql.rb', line 2177

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