Sha256: ddcdb6a3e541b03a73081dc48600eb2f00628809fd72fa77a5402b6a13c2c771

Contents?: true

Size: 230 Bytes

Versions: 8

Compression:

Stored size: 230 Bytes

Contents

class Proc

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

end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
mpatch-1.3.0 lib/mpatch/proc.rb
mpatch-1.2.0 lib/mpatch/proc.rb
procemon-0.1.1 lib/procemon/mpatch/proc.rb
procemon-0.0.9 lib/procemon/mpatch/proc.rb
procemon-0.0.8 lib/procemon/mpatch/proc.rb
procemon-0.0.7 lib/procemon/mpatch/proc.rb
procemon-0.0.6 lib/procemon/mpatch/proc.rb
procemon-0.0.5 lib/procemon/mpatch/proc.rb