class DEBUGGER__::LimitedPP

Attributes

buf[R]

Public Class Methods

new(max) click to toggle source
# File debug-1.8.0/lib/debug/session.rb, line 2320
def initialize max
  @max = max
  @cnt = 0
  @buf = String.new
end
pp(obj, max=80) click to toggle source
# File debug-1.8.0/lib/debug/session.rb, line 2310
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.8.0/lib/debug/session.rb, line 2326
def <<(other)
  @buf << other

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