Parent

Class/Module Index [+]

Quicksearch

RSpec::Mocks::InstanceMethodStasher

@private

Public Class Methods

new(klass, method) click to toggle source
# File lib/rspec/mocks/instance_method_stasher.rb, line 5
def initialize(klass, method)
  @klass = klass
  @method = method

  @method_is_stashed = false
end

Public Instance Methods

method_is_stashed?() click to toggle source

@private

# File lib/rspec/mocks/instance_method_stasher.rb, line 13
def method_is_stashed?
  @method_is_stashed
end
restore() click to toggle source

@private

# File lib/rspec/mocks/instance_method_stasher.rb, line 75
def restore
  return unless @method_is_stashed

  @klass.__send__(:alias_method, @method, stashed_method_name)
  @klass.__send__(:remove_method, stashed_method_name)
  @method_is_stashed = false
end
stash() click to toggle source

@private

# File lib/rspec/mocks/instance_method_stasher.rb, line 18
def stash
  return if !method_defined_directly_on_klass? || @method_is_stashed

  @klass.__send__(:alias_method, stashed_method_name, @method)
  @method_is_stashed = true
end
stashed_method_name() click to toggle source

@private

# File lib/rspec/mocks/instance_method_stasher.rb, line 70
def stashed_method_name
  "obfuscated_by_rspec_mocks__#{@method}"
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.