Class: Byebug::VarClassVarCommand

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

Overview

Implements byebug’s ‘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, format_subcmd, format_subcmds, help, 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 Byebug::Command

Class Method Details

.descriptionObject



48
49
50
51
52
# File 'lib/byebug/commands/variables.rb', line 48

def description
  %{
    v[ar] cl[ass] \t\t\tshow class variables of self
  }
end

.namesObject



44
45
46
# File 'lib/byebug/commands/variables.rb', line 44

def names
  %w(var)
end

Instance Method Details

#executeObject



35
36
37
38
39
40
41
# File 'lib/byebug/commands/variables.rb', line 35

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

#regexpObject



31
32
33
# File 'lib/byebug/commands/variables.rb', line 31

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