class Lumberjack::Formatter::PrettyPrintFormatter
Format an object with it's pretty print method.
Attributes
width[RW]
Public Class Methods
new(width = 79)
click to toggle source
Create a new formatter. The maximum width of the message can be specified with the width parameter (defaults to 79 characters).
# File lib/lumberjack/formatter/pretty_print_formatter.rb, line 14 def initialize(width = 79) @width = width end
Public Instance Methods
call(obj)
click to toggle source
# File lib/lumberjack/formatter/pretty_print_formatter.rb, line 18 def call(obj) s = StringIO.new PP.pp(obj, s) s.string.chomp end