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.



2453
2454
2455
2456
# File 'lib/voruby/adql/adql.rb', line 2453

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

Instance Attribute Details

#expressionObject

Returns the value of attribute expression.



2451
2452
2453
# File 'lib/voruby/adql/adql.rb', line 2451

def expression
  @expression
end

#setObject

Returns the value of attribute set.



2451
2452
2453
# File 'lib/voruby/adql/adql.rb', line 2451

def set
  @set
end

Class Method Details

.from_xml(node) ⇒ Object



2472
2473
2474
2475
2476
2477
2478
# File 'lib/voruby/adql/adql.rb', line 2472

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



2468
2469
2470
# File 'lib/voruby/adql/adql.rb', line 2468

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