Module: Ramda::Internal::CurriedMethod

Included in:
Function, List, Logic, Math, Object, Relation, String
Defined in:
lib/ramda/internal/curried_method.rb

Overview

Curried Method

Instance Method Summary collapse

Instance Method Details

#curried_method(name, &block) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/ramda/internal/curried_method.rb', line 5

def curried_method(name, &block)
  define_singleton_method(name) do |*args|
    curried = block.curry

    return curried if args.empty?

    curried.call(*args)
  end
end