lib/spy/subroutine.rb
# invoke that the method has been called. You really shouldn't use this
# method.
invoke that the method has been called. You really shouldn't use this
method.
invoke that the method has been called . You really shouldn ' t use this method .
def invoke(object, args, block, called_from)
      check_arity!(args.size)
      result =
        if @call_through
          call_through_plan = build_call_through_plan(object)
          call_through_plan.call(*args, &block)
        elsif @plan
          check_for_too_many_arguments!(@plan)
          if base_object.is_a? Class
            @plan.call(object, *args, &block)
          else
            @plan.call(*args, &block)
          end
        end
    ensure
      calls << CallLog.new(object, called_from, args, block, result)
    end
def invoke ( object , args , block , called_from ) check_arity! ( args . size ) result = if @call_through call_through_plan = build_call_through_plan ( object ) call_through_plan . call ( * args , & block ) elsif @plan check_for_too_many_arguments! ( @plan ) if base_object . is_a? Class @plan . call ( object , * args , & block ) else @plan . call ( * args , & block ) end end ensure calls << CallLog . new ( object , called_from , args , block , result ) end
invoke that the method has been called.
invoke that the method has been called .
object
<not_specific>
args
<not_specific>
block
<not_specific>
called_from
<not_specific>