Class: VORuby::ADQL::OrderExpression

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

Overview

List of expressions in which order the results should be provided.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(items) ⇒ OrderExpression

Returns a new instance of OrderExpression.



2372
2373
2374
# File 'lib/voruby/adql/adql.rb', line 2372

def initialize(items)
  self.items = items
end

Instance Attribute Details

#itemsObject

Returns the value of attribute items.



2370
2371
2372
# File 'lib/voruby/adql/adql.rb', line 2370

def items
  @items
end

Class Method Details

.from_xml(node) ⇒ Object



2391
2392
2393
2394
2395
2396
2397
2398
2399
# File 'lib/voruby/adql/adql.rb', line 2391

def self.from_xml(node)
  items = []
  node.elements.each('Item') do |item_node|
    item = Item.from_xml(item_node)
    items.push(item)
  end

  return OrderExpression.new(items)
end

Instance Method Details

#to_adqlsObject



470
471
472
473
# File 'lib/voruby/adql/transforms.rb', line 470

def to_adqls
  items = self.items.collect{|x| x.to_adqls}.join(', ')
  "ORDER BY #{items}"
end

#to_sObject



2386
2387
2388
2389
# File 'lib/voruby/adql/adql.rb', line 2386

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