- More robust testing
- Better error handling
- Keyword argument support
Variable arity invoker methods are handled properly. Variable arity initializers will result in a more meaningful exception being raised.
When all the arguments of the initializer are passed and the instance method is zero arity the instance method will be called.
class Greeter
def initialize(name)
@name = name
end
def call
"Hello #{name}"
end
end
Greeter.call("Jane") # => "Hello Jane"
Greeter.call("John") # => #<Greeter ...> (before 0.7.1)
-
Added helper methods
juxtapose
,knit
,compose
,identity
,always
,guarded
,partial
, andcoerce
that can be used as module functions onInvokable
or in classes that mixin theInvokable
module. -
For classes whose initialize method takes no arguments, when the class method
call
is called it will initialize the class and call it'scall
method. -
[]
and===
are added to classed that mixinInvokable
for betterProc
compatibility. -
Array
,Hash
andSet
patches no longer include the invokable methods, they simply addto_proc
. -
When
invokable/data
is required the array patch is also loaded. -
All the methods that take an invokable will "coerce" the invokable by simply returning it if it implements
call
or coercing it into a proc if it implementsto_proc
.
Invokable::Closure
deprecated comparable behavior has been added toInvokable
itself.
Invokable::Command
deprecated in favor ofInvokable::Closure
.
- Added
Invokable::Command
andInvokable::Core#arity
invokable/array
is no longer loaded withinvokable/data
. This created a bit of havok in a few places. Including breaking puma bootup in Rails 5.2.4.1.