Sha256: c485711880dadece5b3f33bcf166b04e21d0fa99c33a7e94c28f91afb3c6247d

Contents?: true

Size: 438 Bytes

Versions: 21

Compression:

Stored size: 438 Bytes

Contents

unless Proc.method_defined?(:<<) || Proc.method_defined?(:>>)
  class Proc
    def <<(g)
      if lambda?
        lambda { |*args, &blk| call(g.call(*args, &blk)) }
      else
        proc { |*args, &blk| call(g.call(*args, &blk)) }
      end
    end

    def >>(g)
      if lambda?
        lambda { |*args, &blk| g.call(call(*args, &blk)) }
      else
        proc { |*args, &blk| g.call(call(*args, &blk)) }
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
backports-3.25.0 lib/backports/2.6.0/proc/compose.rb
backports-3.24.1 lib/backports/2.6.0/proc/compose.rb
backports-3.24.0 lib/backports/2.6.0/proc/compose.rb
backports-3.23.0 lib/backports/2.6.0/proc/compose.rb
backports-3.22.1 lib/backports/2.6.0/proc/compose.rb
backports-3.22.0 lib/backports/2.6.0/proc/compose.rb
backports-3.21.0 lib/backports/2.6.0/proc/compose.rb
backports-3.20.2 lib/backports/2.6.0/proc/compose.rb
backports-3.20.1 lib/backports/2.6.0/proc/compose.rb
backports-3.20.0 lib/backports/2.6.0/proc/compose.rb
backports-3.19.0 lib/backports/2.6.0/proc/compose.rb
backports-3.18.2 lib/backports/2.6.0/proc/compose.rb
backports-3.18.1 lib/backports/2.6.0/proc/compose.rb
backports-3.18.0 lib/backports/2.6.0/proc/compose.rb
backports-3.17.2 lib/backports/2.6.0/proc/compose.rb
backports-3.17.1 lib/backports/2.6.0/proc/compose.rb
backports-3.17.0 lib/backports/2.6.0/proc/compose.rb
backports-3.16.1 lib/backports/2.6.0/proc/compose.rb
backports-3.16.0 lib/backports/2.6.0/proc/compose.rb
honeybadger-4.5.3 vendor/bundle/ruby/2.6.0/gems/backports-3.15.0/lib/backports/2.6.0/proc/compose.rb