Sha256: 1d27c97a2f8985db0560fef91071092e2ea9ded2c5c705678a3d6ed815318ff1

Contents?: true

Size: 301 Bytes

Versions: 15

Compression:

Stored size: 301 Bytes

Contents

module Stages
  class ResumeCount < Stage    
    def input
      result = Hash.new{ |h, k| h[k] = 0 }
      while v = source.run
        result[v] += 1
      end
      continued = @source.reset
      if continued.nil?
        nil
      else
        { continued => result}
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
stages-0.3.4 lib/stages/resume_count.rb
stages-0.3.3 lib/stages/resume_count.rb
stages-0.3.2 lib/stages/resume_count.rb
stages-0.3.1 lib/stages/resume_count.rb
stages-0.3.0 lib/stages/resume_count.rb
stages-0.2.10 lib/stages/resume_count.rb
stages-0.2.9 lib/stages/resume_count.rb
stages-0.2.8 lib/stages/resume_count.rb
stages-0.2.7 lib/stages/resume_count.rb
stages-0.2.6 lib/stages/resume_count.rb
stages-0.2.5 lib/stages/resume_count.rb
stages-0.2.4 lib/stages/resume_count.rb
stages-0.2.3 lib/stages/resume_count.rb
stages-0.2.2 lib/stages/resume_count.rb
stages-0.2.1 lib/stages/resume_count.rb