Sha256: 1fcfd18b1578bcbb5cc1c846d6c81c6015596afeb3fce30d34a60db206ea912c

Contents?: true

Size: 338 Bytes

Versions: 11

Compression:

Stored size: 338 Bytes

Contents

module MPatch

  module Include

    module Proc

      # sugar syntax for proc * operator
      #    a = ->(x){x+1}
      #    b = ->(x){x*10}
      #    c = b*a
      #    c.call(1) #=> 20
      def *(other)
        self.class.new { |*args| self[*other[*args]] }
      end

    end

  end

  require File.join 'mpatch','injector'


end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
mpatch-2.12.2 lib/mpatch/proc.rb
mpatch-2.12.1 lib/mpatch/proc.rb
mpatch-2.12.0 lib/mpatch/proc.rb
mpatch-2.11.0 lib/mpatch/proc.rb
mpatch-2.9.0 lib/mpatch/proc.rb
mpatch-2.8.1 lib/mpatch/proc.rb
mpatch-2.8.0 lib/mpatch/proc.rb
mpatch-2.7.0 lib/mpatch/proc.rb
mpatch-2.6.0 lib/mpatch/proc.rb
mpatch-2.5.0 lib/mpatch/proc.rb
mpatch-2.4.0 lib/mpatch/proc.rb