Sha256: b4933d5bdcfb4af9c9b430bb6d7a1f66a032d21e2f95e284104025f5df5696b3

Contents?: true

Size: 580 Bytes

Versions: 2

Compression:

Stored size: 580 Bytes

Contents

module Alf
  module Operator::Relational
    class Ungroup < Alf::Operator()
      include Operator::Relational, Operator::Unary
      
      signature do |s|
        s.argument :attr, AttrName, :grouped
      end
      
      protected 
  
      # See Operator#_each
      def _each
        each_input_tuple do |tuple|
          tuple = tuple.dup
          subrel = tuple.delete(@attr)
          subrel.each do |subtuple|
            yield(tuple.merge(subtuple))
          end
        end
      end
  
    end # class Ungroup
  end # module Operator::Relational
end # module Alf

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
alf-0.10.1 lib/alf/operator/relational/ungroup.rb
alf-0.10.0 lib/alf/operator/relational/ungroup.rb