class RSpec::Mocks::NamedObjectReference

@private
by the string.
Represents a reference to the object named (via a constant lookup)
or ‘object_double`.
Used when a string is passed to `class_double`, `instance_double`

def const_to_replace

def const_to_replace
  @const_name
end

def defined?

def defined?
  !!object
end

def initialize(const_name)

def initialize(const_name)
  @const_name = const_name
end

def object

def object
  @object ||= Constant.original(@const_name).original_value
end

def when_loaded(&block)

def when_loaded(&block)
  yield object if object
end