summaryrefslogtreecommitdiff
path: root/lib/pp.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-06-16 17:05:22 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-06-16 17:05:22 +0000
commiteeda97f8e39354d8a57c5bdd3ab0b5e4bda22a0d (patch)
treeb8526463833b8fcb8b51270567fffe2c68a9e0f0 /lib/pp.rb
parent53a31d9df49cd67a57240d52c881ebf609583fc6 (diff)
* lib/pp.rb (Kernel#pretty_inspect): defined for pretty printed
string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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 dc5856dab0..992369911d 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)
}