Class: Aruba::Matchers::ObjectFormatter::DelegatingInspector

Inherits:
Struct
  • Object
show all
Defined in:
lib/aruba/matchers/base/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



99
100
101
# File 'lib/aruba/matchers/base/object_formatter.rb', line 99

def object
  @object
end

Instance Method Details

#inspectObject



100
101
102
103
104
105
106
# File 'lib/aruba/matchers/base/object_formatter.rb', line 100

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

#pretty_print(pp) ⇒ Object



108
109
110
# File 'lib/aruba/matchers/base/object_formatter.rb', line 108

def pretty_print(pp)
  pp.text inspect
end