Class: Proc

Inherits:
Object show all
Defined in:
lib/beethoven/proc.rb

Overview

Require ‘beethoven/proc` to monkey patch Proc with these composition helpers.

Instance Method Summary collapse

Instance Method Details

#*(other) ⇒ Object



3
4
5
# File 'lib/beethoven/proc.rb', line 3

def *(other)
  -> x { call(other.call(x)) }
end

#|(other) ⇒ Object



7
8
9
# File 'lib/beethoven/proc.rb', line 7

def |(other)
  -> x { other.call(call(x)) }
end