class RSpec::Mocks::DirectObjectReference

@see NamedObjectReference
Represents a reference to that object.
or {ExampleMethods#class_double}.
an anonymous class or module is passed to {ExampleMethods#instance_double}
Used when an object is passed to {ExampleMethods#object_double}, or
An implementation of rspec-mocks’ reference interface.

def const_to_replace

is invalid when passing an object argument to `object_double`.
implementations. Raises an `ArgumentError` to indicate that `as_stubbed_const`
Defined for interface parity with the other object reference
def const_to_replace
  raise ArgumentError,
        "Can not perform constant replacement with an anonymous object."
end

def defined?

Returns:
  • (true) -
def defined?
  true
end

def description

Returns:
  • (String) - the object's description (via `#inspect`).
def description
  @object.inspect
end

def initialize(object)

Parameters:
  • object (Object) -- the object to which this refers
def initialize(object)
  @object = object
end

def target

Returns:
  • (Object) -
def target
  @object
end

def when_loaded

Other tags:
    Yield: - the target of this reference.
def when_loaded
  yield @object
end