Class: VORuby::ADQL::From

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

Overview

Represents the From part of the query.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tables) ⇒ From

Returns a new instance of From.



2091
2092
2093
# File 'lib/voruby/adql/adql.rb', line 2091

def initialize(tables)
 self.tables = tables
end

Instance Attribute Details

#tablesObject

Returns the value of attribute tables.



2089
2090
2091
# File 'lib/voruby/adql/adql.rb', line 2089

def tables
  @tables
end

Class Method Details

.from_xml(node) ⇒ Object



2110
2111
2112
2113
2114
2115
2116
2117
2118
# File 'lib/voruby/adql/adql.rb', line 2110

def self.from_xml(node)
  table_list = []
  node.elements.each("Table") do |tbl_node|
    table = Table.from_xml(tbl_node)
    table_list.push(table)
  end

  return From.new(table_list)
end

Instance Method Details

#to_adqlsObject



407
408
409
410
# File 'lib/voruby/adql/transforms.rb', line 407

def to_adqls
  	    tables = self.tables.collect{|x| x.to_adqls}.join(', ')
  	    "FROM #{tables}"
end

#to_adqlxObject



412
413
414
415
416
417
418
# File 'lib/voruby/adql/transforms.rb', line 412

def to_adqlx
  from = "<From>\n"
  from << self.tables.collect{|x| x.to_adqlx}.join("\n")
  from << "\n</From>\n"

  return from
end

#to_sObject



2105
2106
2107
2108
# File 'lib/voruby/adql/adql.rb', line 2105

def to_s
  tables = self.tables.collect{|x| x.to_s}.join('|')
  "{tables=#{tables}}"
end