instance method
PP::PPMethods#pp_hash_pair
pp_hash_pair(k, v)
lib/pp.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/pp.rb, line 314
def pp_hash_pair(k, v)
if Symbol === k
if k.inspect.match?(%r[\A:["$@!]|[%&*+\-\/<=>@\]^`|~]\z])
k = k.to_s.inspect
end
text "#{k}:"
else
pp k
text ' '
text '=>'
end
group(1) {
breakable
pp v
}
end
A pretty print for a pair of Hash