Class: RSpec::Mocks::ObjectMethodReference Private
Do not use. This class is for internal use only.
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Subclasses:
RSpec::Mocks::ClassNewMethodReference
|
|
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
MethodReference
|
|
Instance Chain:
self,
MethodReference
|
|
Inherits: |
RSpec::Mocks::MethodReference
|
Defined in: | rspec-mocks/lib/rspec/mocks/method_reference.rb |
Class Method Summary
- .for(object_reference, method_name) Internal use only
MethodReference
- Inherited
Instance Attribute Summary
MethodReference
- Inherited
#defined? | A method is defined if we are able to get a |
#implemented? | A method is implemented if sending the message does not result in a |
#unimplemented? | Returns true if we definitively know that sending the method will result in a |
Instance Method Summary
- #find_method(object) private Internal use only
- #method_defined?(object) ⇒ Boolean private Internal use only
- #method_implemented?(object) ⇒ Boolean private Internal use only
- #visibility_from(object) private Internal use only
MethodReference
- Inherited
Class Method Details
.for(object_reference, method_name)
[ GitHub ]# File 'rspec-mocks/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
Instance Method Details
#find_method(object) (private)
[ GitHub ]# File 'rspec-mocks/lib/rspec/mocks/method_reference.rb', line 168
def find_method(object) object.method(@method_name) end
#method_defined?(object) ⇒ Boolean
(private)
# File 'rspec-mocks/lib/rspec/mocks/method_reference.rb', line 164
def method_defined?(object) (class << object; self; end).method_defined?(@method_name) end
#method_implemented?(object) ⇒ Boolean
(private)
# File 'rspec-mocks/lib/rspec/mocks/method_reference.rb', line 160
def method_implemented?(object) object.respond_to?(@method_name, true) end
#visibility_from(object) (private)
[ GitHub ]# File 'rspec-mocks/lib/rspec/mocks/method_reference.rb', line 172
def visibility_from(object) MethodReference.method_visibility_for(object, @method_name) end