Class IRB::Frame
In: lib/irb/frame.rb
Parent: Object

Methods

bottom   bottom   new   sender   top   top   trace_func  

Constants

INIT_STACK_TIMES = 3
CALL_STACK_OFFSET = 3

Public Class methods

singleton functions

[Source]

    # File lib/irb/frame.rb, line 50
50:     def Frame.bottom(n = 0)
51:       @backtrace.bottom(n)
52:     end

[Source]

    # File lib/irb/frame.rb, line 24
24:     def initialize
25:       @frames = [TOPLEVEL_BINDING] * INIT_STACK_TIMES
26:     end

[Source]

    # File lib/irb/frame.rb, line 58
58:     def Frame.sender
59:       eval "self", @backtrace.top
60:     end

[Source]

    # File lib/irb/frame.rb, line 54
54:     def Frame.top(n = 0)
55:       @backtrace.top(n)
56:     end

Public Instance methods

[Source]

    # File lib/irb/frame.rb, line 43
43:     def bottom(n = 0)
44:       bind = @frames[n]
45:       Fail FrameOverflow unless bind
46:       bind
47:     end

[Source]

    # File lib/irb/frame.rb, line 37
37:     def top(n = 0)
38:       bind = @frames[-(n + CALL_STACK_OFFSET)]
39:       Fail FrameUnderflow unless bind
40:       bind
41:     end

[Source]

    # File lib/irb/frame.rb, line 28
28:     def trace_func(event, file, line, id, binding)
29:       case event
30:       when 'call', 'class'
31:         @frames.push binding
32:       when 'return', 'end'
33:         @frames.pop
34:       end
35:     end

[Validate]