Sha256: 37dbf6b593179d89f37cbdf9ad284d73e4f82f288c8aa2736bc4c6c45044f41e

Contents?: true

Size: 539 Bytes

Versions: 16

Compression:

Stored size: 539 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

16 entries across 16 versions & 1 rubygems

Version Path
ruby-next-core-0.15.0 lib/ruby-next/core/proc/compose.rb
ruby-next-core-0.14.1 lib/ruby-next/core/proc/compose.rb
ruby-next-core-0.14.0 lib/ruby-next/core/proc/compose.rb
ruby-next-core-0.13.3 lib/ruby-next/core/proc/compose.rb
ruby-next-core-0.13.2 lib/ruby-next/core/proc/compose.rb
ruby-next-core-0.13.1 lib/ruby-next/core/proc/compose.rb
ruby-next-core-0.13.0 lib/ruby-next/core/proc/compose.rb
ruby-next-core-0.12.0 lib/ruby-next/core/proc/compose.rb
ruby-next-core-0.11.1 lib/ruby-next/core/proc/compose.rb
ruby-next-core-0.11.0 lib/ruby-next/core/proc/compose.rb
ruby-next-core-0.10.5 lib/ruby-next/core/proc/compose.rb
ruby-next-core-0.10.4 lib/ruby-next/core/proc/compose.rb
ruby-next-core-0.10.3 lib/ruby-next/core/proc/compose.rb
ruby-next-core-0.10.2 lib/ruby-next/core/proc/compose.rb
ruby-next-core-0.10.1 lib/ruby-next/core/proc/compose.rb
ruby-next-core-0.10.0 lib/ruby-next/core/proc/compose.rb