Module: Kernel

Defined in:
lib/pp.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.pp(*objs) ⇒ Object

prints arguments in pretty form.

pp returns argument(s).



588
589
590
591
592
593
# File 'lib/pp.rb', line 588

def pp(*objs)
  objs.each {|obj|
    PP.pp(obj)
  }
  objs.size <= 1 ? objs.first : objs
end

Instance Method Details

#pretty_inspectObject

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.



581
582
583
# File 'lib/pp.rb', line 581

def pretty_inspect
  PP.pp(self, ''.dup)
end