Class: Byebug::CommandProcessor::State

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/byebug/processors/command_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.



221
222
223
224
225
# File 'lib/byebug/processors/command_processor.rb', line 221

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.



218
219
220
# File 'lib/byebug/processors/command_processor.rb', line 218

def commands
  @commands
end

#contextObject

Returns the value of attribute context.



218
219
220
# File 'lib/byebug/processors/command_processor.rb', line 218

def context
  @context
end

#displayObject

Returns the value of attribute display.



218
219
220
# File 'lib/byebug/processors/command_processor.rb', line 218

def display
  @display
end

#fileObject

Returns the value of attribute file.



218
219
220
# File 'lib/byebug/processors/command_processor.rb', line 218

def file
  @file
end

#frame_posObject

Returns the value of attribute frame_pos.



218
219
220
# File 'lib/byebug/processors/command_processor.rb', line 218

def frame_pos
  @frame_pos
end

#interfaceObject

Returns the value of attribute interface.



219
220
221
# File 'lib/byebug/processors/command_processor.rb', line 219

def interface
  @interface
end

#lineObject

Returns the value of attribute line.



219
220
221
# File 'lib/byebug/processors/command_processor.rb', line 219

def line
  @line
end

#previous_lineObject

Returns the value of attribute previous_line.



219
220
221
# File 'lib/byebug/processors/command_processor.rb', line 219

def previous_line
  @previous_line
end

Instance Method Details

#locationObject



238
239
240
241
242
243
# File 'lib/byebug/processors/command_processor.rb', line 238

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

#proceedObject



234
235
236
# File 'lib/byebug/processors/command_processor.rb', line 234

def proceed
  @proceed = true
end

#proceed?Boolean

Returns:

  • (Boolean)


230
231
232
# File 'lib/byebug/processors/command_processor.rb', line 230

def proceed?
  @proceed
end