File Manager

Path: /opt/chef/embedded/lib/ruby/gems/2.7.0/gems/tins-1.25.0/lib/tins/

Viewing File: proc_compose.rb

module Tins
  module ProcCompose
    def compose(other)
      self.class.new do |*args|
        if other.respond_to?(:call)
          call(*other.call(*args))
        else
          call(*other.to_proc.call(*args))
        end
      end
    end

    alias * compose
  end
end