123456789_123456789_123456789_123456789_123456789_

Class: RSpec::Support::ObjectFormatter::UninspectableObjectInspector Private

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, BaseInspector, Struct
Instance Chain:
self, BaseInspector, Struct
Inherits: RSpec::Support::ObjectFormatter::BaseInspector
Defined in: rspec-support/lib/rspec/support/object_formatter.rb

Constant Summary

Class Method Summary

Instance Attribute Summary

Instance Method Summary

BaseInspector - Inherited

Class Method Details

.can_inspect?(object) ⇒ Boolean

[ GitHub ]

  
# File 'rspec-support/lib/rspec/support/object_formatter.rb', line 200

def self.can_inspect?(object)
  object.inspect
  false
rescue NoMethodError
  true
end

Instance Method Details

#inspect

[ GitHub ]

  
# File 'rspec-support/lib/rspec/support/object_formatter.rb', line 207

def inspect
  "#<#{klass}:#{native_object_id}>"
end

#klass

[ GitHub ]

  
# File 'rspec-support/lib/rspec/support/object_formatter.rb', line 211

def klass
  Support.class_of(object)
end

#native_object_id

[ GitHub ]

  
# File 'rspec-support/lib/rspec/support/object_formatter.rb', line 216

def native_object_id
  OBJECT_ID_FORMAT % (object.__id__ << 1)
rescue NoMethodError
  # In Ruby 1.9.2, BasicObject responds to none of #__id__, #object_id, #id...
  '-'
end