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


94
95
96
# File 'lib/aruba/matchers/base/object_formatter.rb', line 94

def object
  @object
end

Instance Method Details

#inspectObject


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

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

#pretty_print(pp) ⇒ Object


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

def pretty_print(pp)
  pp.text inspect
end