Sha256: 95d964835623c3e5bba41e260f57efe2c9257cc3c18cb9013d81544314aa547f

Contents?: true

Size: 669 Bytes

Versions: 1

Compression:

Stored size: 669 Bytes

Contents

# frozen_string_literal: true

require "pull/version"

require "pull/source/values"
require "pull/source/infinity"

require "pull/through/map"
require "pull/through/filter"
require "pull/through/take"

require "pull/sink/drain"
require "pull/sink/collect"
require "pull/sink/log"
require "pull/sink/reduce"

require "pull/helper"

module Pull
  def pull(*args)
    return Pull::Helper.new if args.empty?
    recurse(nil, args)
    true
  end

  private

  def recurse(streamer, args)
    return if args.empty?
    arg = args.shift
    raise TypeError unless arg.respond_to?(:call)

    recurse(
      streamer.nil? ? arg.() : arg.(streamer),
      args
    )
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pull_stream-1.0.0 lib/pull.rb