lib/invocations/invocation.rb
# Prepares an Invocation, and invokes it if able.
#
# If the provided parameters produce a properly prepared Invocation, it will
# be invoked. Otherwise, it will be returned.
#
# @note This is very similar to how #call works with a curried Proc.
#
Prepares an Invocation, and invokes it if able.
If the provided parameters produce a properly prepared Invocation, it will
be invoked. Otherwise, it will be returned.
Prepares an Invocation and invokes it if able . If the provided parameters produce a properly prepared Invocation it will be invoked . Otherwise it will be returned .
def call(*rest, **keyrest, &block)
    if block || [rest, keyrest].all?(&:empty?)
      prepared? ? invoke : self
    else
      function = prepare(*rest, **keyrest, &block)
      function.prepared? ? function.send(:invoke) : function
    end
  end
def call ( * rest , ** keyrest , & block ) if block || [ rest , keyrest ] . all? ( & :empty? ) prepared? ? invoke : self else function = prepare ( * rest , ** keyrest , & block ) function . prepared? ? function . send ( :invoke ) : function end end
Prepares an Invocation, and invokes it if able.
Prepares an Invocation and invokes it if able .
rest
<not_specific>
keyrest
<not_specific>
block
<not_specific>
note
This is very similar to how #call works with a curried Proc.
This is very similar to how #call works with a curried Proc .