class Byebug::VarInheritCommand

Implements byebug’s ‘var inherit’ command

def description

def description
  %{v[ar] ct\t\t\tshow class heirarchy of object}
end

def execute

def execute
  unless @state.context
    errmsg "can't get object inheritance.\n"
    return
  end
  puts @match.post_match
  obj = debug_eval("#{@match.post_match}.classtree")
  if obj
    print obj
  else
    errmsg "Trouble getting object #{@match.post_match}\n"
  end
end

def names

def names
  %w(var)
end

def regexp

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