We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 85b0b95 commit 8288abbCopy full SHA for 8288abb
lib/rich-text/op.rb
@@ -135,7 +135,10 @@ def to_json(*args)
135
# RichText::Op.new(:insert, 'abc', { bold: true }).inspect(false) => 'insert="abc" {:bold=>true}'
136
def inspect(wrap = true)
137
str = "#{type}=#{value.inspect}"
138
- str << " #{attributes.inspect}" if attributes?
+ if attributes?
139
+ formatted_attrs = attributes.map { |k,v| "#{k.inspect}=>#{v.inspect}" }.join(', ')
140
+ str << " {#{formatted_attrs}}"
141
+ end
142
wrap ? "#<#{self.class.name} #{str}>" : str
143
end
144
0 commit comments