diff options
author | OKURA Masafumi <masafumi.o1988@gmail.com> | 2023-07-19 17:38:07 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-10-25 16:49:09 +0900 |
commit | bf1362306e2c799b0e5ff222b0cdcdb8644adc27 (patch) | |
tree | 7256b181fc4529b0acb8b55ea9294513e3aa1476 /lib/pp.rb | |
parent | 5461bc18f88f7f335f6456774498efd386c3012f (diff) | |
download | ruby-bf1362306e2c799b0e5ff222b0cdcdb8644adc27.tar.gz |
[Doc] Improve documentation of PP
* Remove mention to `require 'pp'` for `pretty_inspect`
* Mention the need to add `require 'pp'` to customize
`#pretty_print(pp)` method
Diffstat (limited to 'lib/pp.rb')
-rw-r--r-- | lib/pp.rb | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -46,6 +46,7 @@ require 'prettyprint' # # To define a customized pretty printing function for your classes, # redefine method <code>#pretty_print(pp)</code> in the class. +# Note that <code>require 'pp'</code> is needed before redefining <code>#pretty_print(pp)</code>. # # <code>#pretty_print</code> takes the +pp+ argument, which is an instance of the PP class. # The method uses #text, #breakable, #nest, #group and #pp to print the @@ -632,10 +633,6 @@ end module Kernel # Returns a pretty printed object as a string. # - # In order to use this method you must first require the PP module: - # - # require 'pp' - # # See the PP module for more information. def pretty_inspect PP.pp(self, ''.dup) |