Class: VORuby::ADQL::V1_0::SubQuerySet

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

Overview

Represents the subquery in a SQL IN expression

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from SerializableToXml

#element

Constructor Details

#initialize(selection) ⇒ SubQuerySet

Returns a new instance of SubQuerySet.



2111
2112
2113
# File 'lib/voruby/adql/1.0/adql.rb', line 2111

def initialize(selection)
  self.selection = selection
end

Instance Attribute Details

#selectionObject

Returns the value of attribute selection.



2107
2108
2109
# File 'lib/voruby/adql/1.0/adql.rb', line 2107

def selection
  @selection
end

Class Method Details

.from_xml(xml) ⇒ Object



2138
2139
2140
2141
2142
# File 'lib/voruby/adql/1.0/adql.rb', line 2138

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

.xml_typeObject



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

def self.xml_type; 'subQuerySet' end

Instance Method Details

#==(s) ⇒ Object



2121
2122
2123
# File 'lib/voruby/adql/1.0/adql.rb', line 2121

def ==(s)
  self.selection == s.selection
end

#to_sObject



2125
2126
2127
# File 'lib/voruby/adql/1.0/adql.rb', line 2125

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

#to_xml(name = nil) ⇒ Object



2129
2130
2131
2132
2133
2134
2135
2136
# File 'lib/voruby/adql/1.0/adql.rb', line 2129

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