Sha256: da7236736e3f7788baf395e40104930a2c2d805dda002cb0a1cd39ea8e90fe7a

Contents?: true

Size: 276 Bytes

Versions: 147

Compression:

Stored size: 276 Bytes

Contents

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

Version data entries

147 entries across 129 versions & 9 rubygems

Version Path
tins-1.37.0 lib/tins/proc_compose.rb
tins-1.36.1 lib/tins/proc_compose.rb
tins-1.36.0 lib/tins/proc_compose.rb
tins-1.35.0 lib/tins/proc_compose.rb
tins-1.34.0 lib/tins/proc_compose.rb
tins-1.33.0 lib/tins/proc_compose.rb
tdiary-5.2.4 vendor/bundle/ruby/3.1.0/gems/tins-1.31.1/lib/tins/proc_compose.rb
tins-1.32.1 lib/tins/proc_compose.rb
tins-1.32.0 lib/tins/proc_compose.rb
tdiary-5.2.3 vendor/bundle/ruby/3.1.0/gems/tins-1.31.1/lib/tins/proc_compose.rb
tdiary-5.2.2 vendor/bundle/ruby/3.1.0/gems/tins-1.31.1/lib/tins/proc_compose.rb
tins-1.31.1 lib/tins/proc_compose.rb
tdiary-5.2.1 vendor/bundle/ruby/3.1.0/gems/tins-1.31.0/lib/tins/proc_compose.rb
tins-1.31.0 lib/tins/proc_compose.rb
tins-1.30.0 lib/tins/proc_compose.rb
tdiary-5.2.0 vendor/bundle/ruby/3.0.0/gems/tins-1.29.1/lib/tins/proc_compose.rb
tdiary-5.2.0 vendor/bundle/ruby/2.7.0/gems/tins-1.29.1/lib/tins/proc_compose.rb
tdiary-5.1.7 vendor/bundle/ruby/3.0.0/gems/tins-1.29.1/lib/tins/proc_compose.rb
tdiary-5.1.7 vendor/bundle/ruby/2.7.0/gems/tins-1.29.1/lib/tins/proc_compose.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tins-1.28.0/lib/tins/proc_compose.rb