Class: VORuby::ADQL::OrderExpression
- 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
-
#items ⇒ Object
Returns the value of attribute items.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(items) ⇒ OrderExpression
constructor
A new instance of OrderExpression.
- #to_adqls ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(items) ⇒ OrderExpression
Returns a new instance of OrderExpression.
2320 2321 2322 |
# File 'lib/voruby/adql/adql.rb', line 2320 def initialize(items) self.items = items end |
Instance Attribute Details
#items ⇒ Object
Returns the value of attribute items.
2318 2319 2320 |
# File 'lib/voruby/adql/adql.rb', line 2318 def items @items end |
Class Method Details
.from_xml(node) ⇒ Object
2339 2340 2341 2342 2343 2344 2345 2346 2347 |
# File 'lib/voruby/adql/adql.rb', line 2339 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_adqls ⇒ Object
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_s ⇒ Object
2334 2335 2336 2337 |
# File 'lib/voruby/adql/adql.rb', line 2334 def to_s items = self.items.collect{|x| x.to_s}.join('|') "{items=#{items}}" end |