Class: RSpec::Support::ObjectFormatter::DelegatingInspector

Inherits:
Struct
  • Object
show all
Defined in:
lib/rspec/support/object_formatter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#objectObject

Returns the value of attribute object

Returns:

  • (Object)

    the current value of object



93
94
95
# File 'lib/rspec/support/object_formatter.rb', line 93

def object
  @object
end

Instance Method Details

#inspectObject



94
95
96
97
98
99
100
# File 'lib/rspec/support/object_formatter.rb', line 94

def inspect
  if defined?(::Delegator) && ::Delegator === object
    "#<#{object.class}(#{ObjectFormatter.format(object.__getobj__)})>"
  else
    object.inspect
  end
end

#pretty_print(pp) ⇒ Object



102
103
104
# File 'lib/rspec/support/object_formatter.rb', line 102

def pretty_print(pp)
  pp.text inspect
end