Editing Topic: RCR215 Project: RCR | RCRchive home

RCR 215: Object#pretty

submitted by ahoward on Fri Feb 13 2004 08:40:53 AM -0800

Status: pending


Abstract

make pretty_printing more available and easier to use

Problem

Proposal

creation of Object#pretty method which is analogous to Object#inspect, only returning result of 'pp' instead of the result from 'p'

Analysis

simply add a method

Implementation

class Object
def pretty s = ''
autoload :PP, 'pp'
PP::pp self, s
s
end
end


Back to RCRchive.


RCR Submission page and RCRchive powered by Ruby, Apache, RuWiki (modified), and RubLog