Class: VORuby::ADQL::ExclusiveSearch

Inherits:
Search show all
Defined in:
lib/voruby/adql/adql.rb,
lib/voruby/adql/transforms.rb

Overview

Represents SQL NOT IN expression.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(expression, set) ⇒ ExclusiveSearch

Returns a new instance of ExclusiveSearch.



1285
1286
1287
1288
# File 'lib/voruby/adql/adql.rb', line 1285

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

Instance Attribute Details

#expressionObject

Returns the value of attribute expression.



1283
1284
1285
# File 'lib/voruby/adql/adql.rb', line 1283

def expression
  @expression
end

#setObject

Returns the value of attribute set.



1283
1284
1285
# File 'lib/voruby/adql/adql.rb', line 1283

def set
  @set
end

Class Method Details

.from_xml(node) ⇒ Object



1309
1310
1311
1312
1313
1314
1315
# File 'lib/voruby/adql/adql.rb', line 1309

def self.from_xml(node)
  expr_node = REXML::XPath.first(node, 'Expression')
  expr = Expression.from_xml(expr_node)
  set_node = REXML::XPath.first(node, 'Set')
  set = Set.from_xml(set_node)
  return ExclusiveSearch.new(expr, set)
end

Instance Method Details

#to_adqlsObject



495
496
497
# File 'lib/voruby/adql/transforms.rb', line 495

def to_adqls
  "#{self.expression.to_adqls} NOT IN (#{self.set.to_adqls})"
end

#to_sObject



1305
1306
1307
# File 'lib/voruby/adql/adql.rb', line 1305

def to_s
	"{expression=#{self.expression},set=#{self.set}}"
end