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