Sha256: 1aabbf9be28d4ac2ad3b1ddfeb3fa5f9a60732a27eac2030a0b8e27373d97d9d

Contents?: true

Size: 675 Bytes

Versions: 13

Compression:

Stored size: 675 Bytes

Contents

module Alf
  class Aggregator
    #
    # Defines a `collect()` aggregation operator.
    #
    # Example:
    #
    #   # direct ruby usage
    #   Alf::Aggregator.collect{ qty }.aggregate(...)
    #
    #   # lispy 
    #   (summarize :supplies, [:sid], :col => collect{ qty })
    #
    class Collect < Aggregator

      # Returns [] as least value.
      #
      # @see Aggregator::InstanceMethods#least
      def least()
        []
      end

      # Aggregates on a tuple occurence.
      #
      # @see Aggregator::InstanceMethods#_happens
      def _happens(memo, val) 
        memo << val
      end

    end # class Collect
  end # class Aggregator
end # module Alf

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
alf-core-0.16.3 lib/alf/aggregator/collect.rb
alf-core-0.16.2 lib/alf/aggregator/collect.rb
alf-core-0.16.1 lib/alf/aggregator/collect.rb
alf-core-0.16.0 lib/alf/aggregator/collect.rb
alf-core-0.15.0 lib/alf/aggregator/collect.rb
alf-core-0.14.0 lib/alf-aggregator/alf/aggregator/collect.rb
alf-core-0.13.1 lib/alf-aggregator/alf/aggregator/collect.rb
alf-core-0.13.0 lib/alf-aggregator/alf/aggregator/collect.rb
alf-0.12.2 lib/alf/aggregator/collect.rb
alf-0.12.1 lib/alf/aggregator/collect.rb
alf-0.12.0 lib/alf/aggregator/collect.rb
alf-0.11.1 lib/alf/aggregator/collect.rb
alf-0.11.0 lib/alf/aggregator/collect.rb