Module | PP::ObjectMixin |
In: |
lib/pp.rb
|
A default pretty printing method for general objects. It calls pretty_print_instance_variables to list instance variables.
If self has a customized (redefined) inspect method, the result of self.inspect is used but it obviously has no line break hints.
This module provides predefined pretty_print methods for some of the most commonly used built-in classes for convenience.
Is inspect implementation using pretty_print. If you implement pretty_print, it can be used as follows.
alias inspect pretty_print_inspect
However, doing this requires that every class that inspect is called on implement pretty_print, or a RuntimeError will be raised.
ruby-doc.org is a service of James Britt and Neurogami, a Ruby application development company in Phoenix, AZ.
Documentation content on ruby-doc.org is provided by remarkable members of the Ruby community.
For more information on the Ruby programming language, visit ruby-lang.org.
Want to help improve Ruby's API docs? See Ruby Documentation Guidelines.