Class: VORuby::ADQL::InclusiveSearch

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

Overview

Represents SQL IN expression.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(expression, set) ⇒ InclusiveSearch

Returns a new instance of InclusiveSearch.



2401
2402
2403
2404
# File 'lib/voruby/adql/adql.rb', line 2401

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

Instance Attribute Details

#expressionObject

Returns the value of attribute expression.



2399
2400
2401
# File 'lib/voruby/adql/adql.rb', line 2399

def expression
  @expression
end

#setObject

Returns the value of attribute set.



2399
2400
2401
# File 'lib/voruby/adql/adql.rb', line 2399

def set
  @set
end

Class Method Details

.from_xml(node) ⇒ Object



2420
2421
2422
2423
2424
2425
2426
# File 'lib/voruby/adql/adql.rb', line 2420

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 InclusiveSearch.new(expr, set)
end

Instance Method Details

#to_adqlsObject



489
490
491
# File 'lib/voruby/adql/transforms.rb', line 489

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

#to_sObject



2416
2417
2418
# File 'lib/voruby/adql/adql.rb', line 2416

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