class RSpec::Mocks::ObjectMethodReference

@private

Public Class Methods

for(object_reference, method_name) click to toggle source
Calls superclass method RSpec::Mocks::MethodReference.for
# File lib/rspec/mocks/method_reference.rb, line 140
def self.for(object_reference, method_name)
  if ClassNewMethodReference.applies_to?(method_name) { object_reference.when_loaded { |o| o } }
    ClassNewMethodReference.new(object_reference, method_name)
  else
    super
  end
end

Private Instance Methods

find_method(object) click to toggle source
# File lib/rspec/mocks/method_reference.rb, line 158
def find_method(object)
  object.method(@method_name)
end
method_defined?(object) click to toggle source
# File lib/rspec/mocks/method_reference.rb, line 154
def method_defined?(object)
  (class << object; self; end).method_defined?(@method_name)
end
method_implemented?(object) click to toggle source
# File lib/rspec/mocks/method_reference.rb, line 150
def method_implemented?(object)
  object.respond_to?(@method_name, true)
end
visibility_from(object) click to toggle source
# File lib/rspec/mocks/method_reference.rb, line 162
def visibility_from(object)
  MethodReference.method_visibility_for(object, @method_name)
end