Class: Proc

Inherits:
Object
  • Object
show all
Defined in:
lib/functional_support/core_ext/proc.rb

Direct Known Subclasses

Hash::HashProc

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.compose(f, g) ⇒ Object



2
3
4
# File 'lib/functional_support/core_ext/proc.rb', line 2

def self.compose(f, g)
  lambda { |*args| f[g[*args]] }
end

Instance Method Details

#<<(g) ⇒ Object



8
9
10
# File 'lib/functional_support/core_ext/proc.rb', line 8

def <<(g)
  self.class.compose(self, g)
end

#>>(g) ⇒ Object



5
6
7
# File 'lib/functional_support/core_ext/proc.rb', line 5

def >>(g)
  self.class.compose(g, self)
end