Sha256: ca3a34aeba7e4550e50032f5d4e09c3ea67b6f369f3e02dfc6f62885247ccfbb
Contents?: true
Size: 543 Bytes
Versions: 13
Compression:
Stored size: 543 Bytes
Contents
# frozen_string_literals: true require "pp" require "stringio" module Lumberjack class Formatter # Format an object with it's pretty print method. class PrettyPrintFormatter attr_accessor :width # Create a new formatter. The maximum width of the message can be specified with the width # parameter (defaults to 79 characters). def initialize(width = 79) @width = width end def call(obj) s = StringIO.new PP.pp(obj, s) s.string.chomp end end end end
Version data entries
13 entries across 13 versions & 3 rubygems