Sha256: a3ec5b9032b1c8b2266c22d5319b7b3e93cb70dbe08f6c390077c10896bfa12b

Contents?: true

Size: 305 Bytes

Versions: 1

Compression:

Stored size: 305 Bytes

Contents

# frozen_string_literal: true

module Pull
  class Log
    DEFAULT_DONE_CALLBACK = -> () {
      puts "DONE"
    }

    def call(read, done = DEFAULT_DONE_CALLBACK)
      raise TypeError unless read.respond_to?(:call)
      Pull::Drain.new do |value|
        puts value
      end.(read)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pull_stream-1.0.0 lib/pull/sink/log.rb