Module: Nasty::LambdaBehaviours

Defined in:
lib/nasty/lambda_behaviours.rb

Instance Method Summary collapse

Instance Method Details

#memoize(lambda_method) ⇒ Object



3
4
5
# File 'lib/nasty/lambda_behaviours.rb', line 3

def memoize(lambda_method)
  lambda { |*args| @cache ||= lambda_method.call(*args) }
end