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



89
90
91
# File 'lib/aruba/matchers/base/object_formatter.rb', line 89

def object
  @object
end

Instance Method Details

#inspectObject



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

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

#pretty_print(pp) ⇒ Object



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

def pretty_print(pp)
  pp.text inspect
end