# class Byebug::VarCommand

Show variables and its values.

### Constants

Subcommands

### Public Class Methods

description() click to toggle source

    # File lib/byebug/commands/var.rb, line 98
    def description
      prettify <<-EOD
        [v]ar

        Show variables and its values.
      EOD
    end

names() click to toggle source

    # File lib/byebug/commands/var.rb, line 94
    def names
      %w(var)
    end

### Public Instance Methods

execute() click to toggle source

    # File lib/byebug/commands/var.rb, line 80
    def execute
      return puts(self.class.help) unless @match[1]

      subcmd = Command.find(Subcommands, @match[1])
      return errmsg("Unknown var command #{@match[1]}\n") unless subcmd

      if @state.context
        send("var_#{subcmd.name}", @match[2])
      else
        errmsg "'var #{subcmd.name}' not available without a context.\n"
      end
    end

regexp() click to toggle source

    # File lib/byebug/commands/var.rb, line 76
    def regexp
      /^\s* v(?:ar)? (?: \s+(\S+) (?:\s(\S+))? )? \s*$/x
    end