class DEBUGGER__::LimitedPP

属性

buf[R]

公共类方法

new(max) 点击切换源代码
# File debug-1.10.0/lib/debug/session.rb, line 2345
def initialize max
  @max = max
  @cnt = 0
  @buf = String.new
end
pp(obj, max=80) 点击切换源代码
# File debug-1.10.0/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

公共实例方法

<<(other) 点击切换源代码
# File debug-1.10.0/lib/debug/session.rb, line 2351
def <<(other)
  @buf << other

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