summaryrefslogtreecommitdiff
path: root/lib/pp.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pp.rb')
-rw-r--r--lib/pp.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/pp.rb b/lib/pp.rb
index 81c8f4822f..540320f626 100644
--- a/lib/pp.rb
+++ b/lib/pp.rb
@@ -46,8 +46,16 @@
require 'prettyprint'
module Kernel
+ # returns a pretty printed object as a string.
+ def pretty_inspect
+ PP.pp(self, '')
+ end
+
private
- def pp(*objs)
+ # prints arguments in pretty form.
+ #
+ # pp returns nil.
+ def pp(*objs) # :doc:
objs.each {|obj|
PP.pp(obj)
}