summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2021-09-05 22:19:48 +0900
committergit <[email protected]>2024-02-21 16:45:01 +0000
commit6e704311bbb7c499f191d9b7d29dac0e37feabde ()
tree61dfaf7b53a44cdfed2e12ad876fbd36cb934d3e /lib
parent37b8fc7477b1cbeb4f3a21ad4b22971170709cfa (diff)
[ruby/pp] Extract pp_hash_pair
The method which prints single pair of a hash, to make extending pretty printing Hash easier, apart from Hash construct itself. https://.com/ruby/pp/commit/3fcf2d1142
-rw-r--r--lib/pp.rb17
1 files changed, 11 insertions, 6 deletions
@@ -286,16 +286,21 @@ class PP < PrettyPrint
group(1, '{', '}') {
seplist(obj, nil, :each_pair) {|k, v|
group {
- pp k
- text '=>'
- group(1) {
- breakable ''
- pp v
- }
}
}
}
end
end
include PPMethods