Class: Byebug::VarClassCommand

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

Overview

Show class 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



97
98
99
# File 'lib/byebug/commands/variables.rb', line 97

def description
  %(v[ar] cl[ass]        Show class variables of self.)
end

.namesObject



93
94
95
# File 'lib/byebug/commands/variables.rb', line 93

def names
  %w(var)
end

Instance Method Details

#executeObject



87
88
89
90
# File 'lib/byebug/commands/variables.rb', line 87

def execute
  return errmsg "can't get class variables here.\n" unless @state.context
  var_class_self
end

#regexpObject



83
84
85
# File 'lib/byebug/commands/variables.rb', line 83

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