class Pry::Command::Ls::LocalVars

Public Class Methods

new(opts, _pry_) click to toggle source
# File lib/pry/commands/ls/local_vars.rb, line 5
def initialize(opts, _pry_)
  super(_pry_)
  @default_switch = opts[:locals]
  @sticky_locals = _pry_.sticky_locals
end

Public Instance Methods

output_self() click to toggle source
# File lib/pry/commands/ls/local_vars.rb, line 11
def output_self
  name_value_pairs = @target.eval('local_variables').reject { |e|
    @sticky_locals.keys.include?(e.to_sym)
  }.map { |name|
    [name, (@target.eval(name.to_s))]
  }
  format(name_value_pairs).join('')
end