Class: Debugger::VarClassVarCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/ruby-debug/commands/variables.rb

Overview

Implements the debugger ‘var class’ command.

Constant Summary

Constants inherited from Command

Command::DEF_OPTIONS

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Command

commands, #find, inherited, #initialize, load_commands, #match, method_missing, options, register_setting_get, register_setting_set, register_setting_var, settings, settings_map

Constructor Details

This class inherits a constructor from Debugger::Command

Class Method Details

.help(cmd) ⇒ Object



49
50
51
52
53
# File 'lib/ruby-debug/commands/variables.rb', line 49

def help(cmd)
  %{
    v[ar] cl[ass] \t\t\tshow class variables of self
  }
end

.help_commandObject



45
46
47
# File 'lib/ruby-debug/commands/variables.rb', line 45

def help_command
  'var'
end

Instance Method Details

#executeObject



36
37
38
39
40
41
42
# File 'lib/ruby-debug/commands/variables.rb', line 36

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

#regexpObject



32
33
34
# File 'lib/ruby-debug/commands/variables.rb', line 32

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