Class: Object

Inherits:
BasicObject
Defined in:
lib/eco/api/common/version_patches/ruby3/object.rb

Instance Method Summary collapse

Instance Method Details

#inspectObject

From ruby3 NameError prints the internals of the object as well as subobjects which is really unnecessary What's the use of such a detail when it's just a missing method at the top of it?

Examples:

class Foo; attr_writer :bar; end
foo = Foo.new
foo2 = Foo.new
foo.bar = foo2
h = {a: 1, b: 2, c: foo}
foo2.bar = h
h.foo
#=> undefined method `foo' for {:a=>1, :b=>2, :c=>#<Foo:0x000002343276b520 @bar=#<Foo:0x0000023437e91ca0 @bar={...}>>}:Hash (NoMethodError)


15
16
17
# File 'lib/eco/api/common/version_patches/ruby3/object.rb', line 15

def inspect
  to_s
end