vendor/gems/flexmock-0.8.5/lib/flexmock/partial_mock.rb
# Stow the existing method definition so that it can be recovered
# later.
Stow the existing method definition so that it can be recovered
later.
Stow the existing method definition so that it can be recovered later .
def stow_existing_definition(method_name)
      @methods_proxied << method_name
      new_alias = create_alias_for_existing_method(method_name)
      if new_alias
        my_object = @obj
        @method_definitions[method_name] = Proc.new { |*args|
          block = nil
          if Proc === args.last
            block = args.last
            args = args[0...-1]
          end
          my_object.send(new_alias, *args, &block)
        }
      end
      remove_current_method(method_name) if singleton?(method_name)
    end
def stow_existing_definition ( method_name ) @methods_proxied << method_name new_alias = create_alias_for_existing_method ( method_name ) if new_alias my_object = @obj @method_definitions [ method_name ] = Proc . new { | * args | block = nil if Proc === args . last block = args . last args = args [ 0 ... - 1 ] end my_object . send ( new_alias , * args , & block ) } end remove_current_method ( method_name ) if singleton? ( method_name ) end
Stow the existing method definition so that it can be recovered
later.
Stow the existing method definition so that it can be recovered later .
method_name