Class: Byebug::VarInstanceCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/byebug/commands/variables.rb

Overview

Show instance variables and its values.

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Command

commands, find, format_subcmd, format_subcmds, help, inherited, #initialize, load_commands, #match

Constructor Details

This class inherits a constructor from Byebug::Command

Class Method Details

.descriptionObject



176
177
178
179
180
# File 'lib/byebug/commands/variables.rb', line 176

def description
  %(v[ar] i[nstance] <object>

  Show instance variables of <object>.)
end

.namesObject



172
173
174
# File 'lib/byebug/commands/variables.rb', line 172

def names
  %w(var)
end

Instance Method Details

#executeObject



167
168
169
# File 'lib/byebug/commands/variables.rb', line 167

def execute
  var_instance(@match.post_match.empty? ? 'self' : @match.post_match)
end

#regexpObject



163
164
165
# File 'lib/byebug/commands/variables.rb', line 163

def regexp
  /^\s* v(?:ar)? \s+ ins(?:tance)? \s*/x
end