Sha256: f87af7ab8ba2aa04be962b63cc3177db04486a81602a1650b3a4fa842bbf50ed
Contents?: true
Size: 452 Bytes
Versions: 4
Compression:
Stored size: 452 Bytes
Contents
# frozen_string_literal: true class MedPipe::PipelineTask::Counter def initialize @count = 0 end # @param context [Hash] # @param input [Enumerable<Array<Object>>] # @yieldparam [Enumerable<Array<Object>>] inputをそのまま流す def call(context, input) yield input.map { |x| increment(context); x } # rubocop:disable Style/Semicolon end def increment(context) @count += 1 context[:data_count] = @count end end
Version data entries
4 entries across 4 versions & 1 rubygems