Sha256: 83c84fb151f20b47107289527ea8b60a86647eeb26f100bf4ebe91746770a056
Contents?: true
Size: 546 Bytes
Versions: 8
Compression:
Stored size: 546 Bytes
Contents
#-- # Source:: extensions gem #++ require 'pp' require 'stringio' class Object # # Returns a pretty-printed string of the object. Requires libraries +pp+ and # +stringio+ from the Ruby standard library. # # The following code pretty-prints an object (much like +p+ plain-prints an # object): # # pp object # # The following code captures the pretty-printing in +str+ instead of # sending it to +STDOUT+. # # str = object.pp_s # def pp_s pps = StringIO.new PP.pp(self, pps) pps.string end end
Version data entries
8 entries across 8 versions & 1 rubygems