Module: Funkify::ClassMethods

Defined in:
lib/funkify.rb

Instance Method Summary collapse

Instance Method Details

#auto_curry(*names) ⇒ Object



82
83
84
85
86
87
88
# File 'lib/funkify.rb', line 82

def auto_curry(*names)
  if names.empty?
    Funkify.auto_curry_all_methods(self)
  else
    Funkify.auto_curry_some_methods(names, self)
  end
end

#point_free(&block) ⇒ Object



90
91
92
93
94
95
# File 'lib/funkify.rb', line 90

def point_free(&block)
  -> (*args) do
    b = instance_exec(&block).curry
    args.empty? ? b : b[*args]
  end
end