Sha256: 98093b9340983d70ca6334f50d44f94bcf54e1d89f4944f884652f095dedeadd

Contents?: true

Size: 496 Bytes

Versions: 2

Compression:

Stored size: 496 Bytes

Contents

module Piglet
  class Group # :nodoc:
    include Relation
    
    def initialize(relation, grouping, options={})
      options ||= {}
      @sources, @grouping, @parallel = [relation], grouping, options[:parallel]
    end
    
    def to_s
      str = "GROUP #{@sources.first.alias} BY "
      if @grouping.size > 1
        str << "(#{@grouping.join(', ')})"
      else
        str << @grouping.first.to_s
      end
      str << " PARALLEL #{@parallel}" if @parallel
      str
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
piglet-0.1.1 lib/piglet/group.rb
piglet-0.1.0 lib/piglet/group.rb