class DEBUGGER__::LimitedPP

Attributes

buf[R]

Public Class Methods

new(max) click to toggle source
# File debug-1.9.2/lib/debug/session.rb, line 2345
def initialize max
  @max = max
  @cnt = 0
  @buf = String.new
end
pp(obj, max=80) click to toggle source
# File debug-1.9.2/lib/debug/session.rb, line 2335
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.2/lib/debug/session.rb, line 2351
def <<(other)
  @buf << other

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