Class: Byebug::CommandProcessor::State

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/byebug/processor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(commands, context, display, file, interface, line) ⇒ State

Returns a new instance of State.



238
239
240
241
242
# File 'lib/byebug/processor.rb', line 238

def initialize(commands, context, display, file, interface, line)
  @commands, @context, @display = commands, context, display
  @file, @interface, @line = file, interface, line
  @frame_pos, @previous_line, @proceed = 0, nil, false
end

Instance Attribute Details

#commandsObject

Returns the value of attribute commands.



235
236
237
# File 'lib/byebug/processor.rb', line 235

def commands
  @commands
end

#contextObject

Returns the value of attribute context.



235
236
237
# File 'lib/byebug/processor.rb', line 235

def context
  @context
end

#displayObject

Returns the value of attribute display.



235
236
237
# File 'lib/byebug/processor.rb', line 235

def display
  @display
end

#fileObject

Returns the value of attribute file.



235
236
237
# File 'lib/byebug/processor.rb', line 235

def file
  @file
end

#frame_posObject

Returns the value of attribute frame_pos.



235
236
237
# File 'lib/byebug/processor.rb', line 235

def frame_pos
  @frame_pos
end

#interfaceObject

Returns the value of attribute interface.



236
237
238
# File 'lib/byebug/processor.rb', line 236

def interface
  @interface
end

#lineObject

Returns the value of attribute line.



236
237
238
# File 'lib/byebug/processor.rb', line 236

def line
  @line
end

#previous_lineObject

Returns the value of attribute previous_line.



236
237
238
# File 'lib/byebug/processor.rb', line 236

def previous_line
  @previous_line
end

Instance Method Details

#locationObject



255
256
257
258
259
260
# File 'lib/byebug/processor.rb', line 255

def location
  loc = "#{CommandProcessor.canonic_file(@file)} @ #{@line}\n"
  loc += "#{Byebug.line_at(@file, @line)}\n" unless
    ['(irb)', '-e'].include? @file
  loc
end

#proceedObject



251
252
253
# File 'lib/byebug/processor.rb', line 251

def proceed
  @proceed = true
end

#proceed?Boolean

Returns:

  • (Boolean)


247
248
249
# File 'lib/byebug/processor.rb', line 247

def proceed?
  @proceed
end