summaryrefslogtreecommitdiffstats
path: root/lib
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
commit3c63783800dce9ee4c936676fba4f10d16f20e23 (patch)
treeb8526463833b8fcb8b51270567fffe2c68a9e0f0 /lib
parent2e36bfe45a599cad634bb0e09502d4d2467a59de (diff)
downloadruby-3c63783800dce9ee4c936676fba4f10d16f20e23.tar.gz
ruby-3c63783800dce9ee4c936676fba4f10d16f20e23.tar.xz
ruby-3c63783800dce9ee4c936676fba4f10d16f20e23.zip
* lib/pp.rb (Kernel#pretty_inspect): defined for pretty printed
string. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@10283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/pp.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/pp.rb b/lib/pp.rb
index dc5856dab..992369911 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)
}