Class: VORuby::ADQL::GroupBy
- Defined in:
- lib/voruby/adql/adql.rb,
lib/voruby/adql/transforms.rb
Overview
Represents the Group By expression part of a query.
Instance Attribute Summary collapse
-
#columns ⇒ Object
Returns the value of attribute columns.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(columns) ⇒ GroupBy
constructor
A new instance of GroupBy.
- #to_adqls ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(columns) ⇒ GroupBy
Returns a new instance of GroupBy.
2039 2040 2041 |
# File 'lib/voruby/adql/adql.rb', line 2039 def initialize(columns) self.columns = columns end |
Instance Attribute Details
#columns ⇒ Object
Returns the value of attribute columns.
2037 2038 2039 |
# File 'lib/voruby/adql/adql.rb', line 2037 def columns @columns end |
Class Method Details
.from_xml(node) ⇒ Object
2058 2059 2060 2061 2062 2063 2064 2065 2066 |
# File 'lib/voruby/adql/adql.rb', line 2058 def self.from_xml(node) columns = [] node.elements.each('Column') do |col_node| col = Column.from_xml(col_node) columns.push(col) end return GroupBy.new(columns) end |
Instance Method Details
#to_adqls ⇒ Object
385 386 387 388 |
# File 'lib/voruby/adql/transforms.rb', line 385 def to_adqls cols = self.columns.collect{|x| x.to_adqls}.join(', ') "GROUP BY #{cols}" end |
#to_s ⇒ Object
2053 2054 2055 2056 |
# File 'lib/voruby/adql/adql.rb', line 2053 def to_s cols = self.columns.collect{|x| x.to_s}.join('|') "{columns=#{cols}}" end |