class DEBUGGER__::LimitedPP

Attributes

buf[R]

Public Class Methods

new(max) click to toggle source
# File debug-1.9.1/lib/debug/session.rb, line 2337
def initialize max
  @max = max
  @cnt = 0
  @buf = String.new
end
pp(obj, max=80) click to toggle source
# File debug-1.9.1/lib/debug/session.rb, line 2327
def self.pp(obj, max=80)
  out = self.new(max)
  catch out do
    PP.singleline_pp(obj, out)
  end
  out.buf
end

Public Instance Methods

<<(other) click to toggle source
# File debug-1.9.1/lib/debug/session.rb, line 2343
def <<(other)
  @buf << other

  if @buf.size >= @max
    @buf = @buf[0..@max] + '...'
    throw self
  end
end