End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
OpenStruct#inspect
inspect
lib/ostruct.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.1.3/lib/ostruct.rb, line 376
def inspect
ids = (Thread.current[InspectKey] ||= [])
if ids.include?(object_id)
detail = ' ...'
else
ids << object_id
begin
detail = @table.map do |key, value|
" #{key}=#{value.inspect}"
end.join(',')
ensure
ids.pop
end
end
['#<', self.class!, detail, '>'].join
end
Returns a string containing a detailed summary of the keys and values.