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 150 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 168 def find_method(object) object.method(@method_name) end
method_defined?(object)
click to toggle source
# File lib/rspec/mocks/method_reference.rb, line 164 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 160 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 172 def visibility_from(object) MethodReference.method_visibility_for(object, @method_name) end