Module: Ramda::Internal::CurriedMethod

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

Overview

Curried Method

Instance Method Summary collapse

Instance Method Details

#curried_method(name, &block) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'lib/ramda/internal/curried_method.rb', line 7

def curried_method(name, &block)
  define_singleton_method(name) do |*args|
    curried = block.curry
    # curried.define_singleton_method(:origin_arity) { block.arity }

    return curried if args.empty?

    curried.call(*args)
  end
end