Class: DEBUGGER__::LimitedPP
Instance Attribute Summary collapse
-
#buf ⇒ Object
readonly
Returns the value of attribute buf.
Class Method Summary collapse
Instance Method Summary collapse
- #<<(other) ⇒ Object
-
#initialize(max) ⇒ LimitedPP
constructor
A new instance of LimitedPP.
Constructor Details
#initialize(max) ⇒ LimitedPP
Returns a new instance of LimitedPP.
2345 2346 2347 2348 2349 |
# File 'lib/debug/session.rb', line 2345 def initialize max @max = max @cnt = 0 @buf = String.new end |
Instance Attribute Details
#buf ⇒ Object (readonly)
Returns the value of attribute buf.
2343 2344 2345 |
# File 'lib/debug/session.rb', line 2343 def buf @buf end |
Class Method Details
.pp(obj, max = 80) ⇒ Object
2335 2336 2337 2338 2339 2340 2341 |
# File '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 |
Instance Method Details
#<<(other) ⇒ Object
2351 2352 2353 2354 2355 2356 2357 2358 |
# File 'lib/debug/session.rb', line 2351 def <<(other) @buf << other if @buf.size >= @max @buf = @buf[0..@max] + '...' throw self end end |