Sha256: 7edec6276f03516d31e3ecf64e0b13c3a774fb18b963f5406c78d56d8615020e

Contents?: true

Size: 504 Bytes

Versions: 10

Compression:

Stored size: 504 Bytes

Contents

# frozen_string_literal: true

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

10 entries across 10 versions & 1 rubygems

Version Path
ruby-next-core-1.1.1 lib/ruby-next/core/proc/compose.rb
ruby-next-core-1.1.0 lib/ruby-next/core/proc/compose.rb
ruby-next-core-1.0.3 lib/ruby-next/core/proc/compose.rb
ruby-next-core-1.0.2 lib/ruby-next/core/proc/compose.rb
ruby-next-core-1.0.1 lib/ruby-next/core/proc/compose.rb
ruby-next-core-1.0.0 lib/ruby-next/core/proc/compose.rb
ruby-next-core-1.0.0.rc.1 lib/ruby-next/core/proc/compose.rb
ruby-next-core-0.15.3 lib/ruby-next/core/proc/compose.rb
ruby-next-core-0.15.2 lib/ruby-next/core/proc/compose.rb
ruby-next-core-0.15.1 lib/ruby-next/core/proc/compose.rb