Sha256: 7b3e427389e68e3224ed36d7eef3da4880b4c33ba2706d1d6cb6aa0f15b2dfcd

Contents?: true

Size: 579 Bytes

Versions: 14

Compression:

Stored size: 579 Bytes

Contents

# frozen_string_literal: true

# rubocop:disable Style/LambdaCall
RubyNext::Core.patch Proc, name: "ProcCompose", method: :<<, version: "2.6" do
  <<~RUBY
    def <<(other)
      raise TypeError, "callable object is expected" unless other.respond_to?(:call)
      this = self
      proc { |*args, &block| this.(other.(*args, &block)) }
    end

    def >>(other)
      raise TypeError, "callable object is expected" unless other.respond_to?(:call)
      this = self
      proc { |*args, &block| other.(this.(*args, &block)) }
    end
  RUBY
end
# rubocop:enable Style/LambdaCall

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
ruby-next-core-0.9.2 lib/ruby-next/core/proc/compose.rb
ruby-next-core-0.9.1 lib/ruby-next/core/proc/compose.rb
ruby-next-core-0.9.0 lib/ruby-next/core/proc/compose.rb
ruby-next-core-0.9.0.pre lib/ruby-next/core/proc/compose.rb
ruby-next-core-0.8.0 lib/ruby-next/core/proc/compose.rb
ruby-next-core-0.7.0 lib/ruby-next/core/proc/compose.rb
ruby-next-core-0.6.0 lib/ruby-next/core/proc/compose.rb
ruby-next-core-0.5.3 lib/ruby-next/core/proc/compose.rb
ruby-next-core-0.5.2 lib/ruby-next/core/proc/compose.rb
ruby-next-core-0.5.1 lib/ruby-next/core/proc/compose.rb
ruby-next-core-0.5.0 lib/ruby-next/core/proc/compose.rb
ruby-next-core-0.4.0 lib/ruby-next/core/proc/compose.rb
ruby-next-0.3.0 lib/ruby-next/core/proc/compose.rb
ruby-next-core-0.3.0 lib/ruby-next/core/proc/compose.rb