In Files

  • irb/frame.rb

IRB::Frame

Public Class Methods

bottom(n = 0) click to toggle source

singleton functions

 
               # File irb/frame.rb, line 50
def Frame.bottom(n = 0)
  @backtrace.bottom(n)
end
            
new() click to toggle source
 
               # File irb/frame.rb, line 24
def initialize
  @frames = [TOPLEVEL_BINDING] * INIT_STACK_TIMES
end
            
sender() click to toggle source
 
               # File irb/frame.rb, line 58
def Frame.sender
  eval "self", @backtrace.top
end
            
top(n = 0) click to toggle source
 
               # File irb/frame.rb, line 54
def Frame.top(n = 0)
  @backtrace.top(n)
end
            

Public Instance Methods

bottom(n = 0) click to toggle source
 
               # File irb/frame.rb, line 43
def bottom(n = 0)
  bind = @frames[n]
  Fail FrameOverflow unless bind
  bind
end
            
top(n = 0) click to toggle source
 
               # File irb/frame.rb, line 37
def top(n = 0)
  bind = @frames[-(n + CALL_STACK_OFFSET)]
  Fail FrameUnderflow unless bind
  bind
end
            
trace_func(event, file, line, id, binding) click to toggle source
 
               # File irb/frame.rb, line 28
def trace_func(event, file, line, id, binding)
  case event
  when 'call', 'class'
    @frames.push binding
  when 'return', 'end'
    @frames.pop
  end
end