End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
OpenStruct#to_s
to_s
lib/ostruct.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.0.5/lib/ostruct.rb, line 341
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
Alias of #inspect
Returns a string containing a detailed summary of the keys and values.