File tree 1 file changed +9
-7
lines changed
1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -83,33 +83,35 @@ def puts(*objects) : Nil
83
83
end
84
84
85
85
# Pretty prints *object* to STDOUT followed
86
- # by a newline.
86
+ # by a newline. Returns *object*.
87
87
#
88
88
# See also: `Object#pretty_print(pp)`.
89
- def p (object ) : Nil
89
+ def p (object )
90
90
PrettyPrint .format(object, STDOUT , 79 )
91
91
puts
92
+ object
92
93
end
93
94
94
95
# Pretty prints each object in *objects* to STDOUT, followed
95
- # by a newline.
96
+ # by a newline. Returns *objects*.
96
97
#
97
98
# See also: `Object#pretty_print(pp)`.
98
- def p (* objects) : Nil
99
+ def p (* objects)
99
100
objects.each do |obj |
100
101
p obj
101
102
end
103
+ objects
102
104
end
103
105
104
106
# Pretty prints each object in *objects* to STDOUT, followed
105
- # by a newline.
107
+ # by a newline. Returns *objects*.
106
108
#
107
109
# ```
108
- # p foo: 23, bar: 42 # prints " {foo: 23, bar: 42}"
110
+ # p foo: 23, bar: 42 # => {foo: 23, bar: 42}
109
111
# ```
110
112
#
111
113
# See `Object#pretty_print(pp)`
112
- def p (** objects) : Nil
114
+ def p (** objects)
113
115
p(objects)
114
116
end
115
117
You can’t perform that action at this time.
0 commit comments