class Pry::Command::Ls::LsEntity

Attributes

pry_instance[R]

Public Class Methods

new(opts) click to toggle source
# File lib/pry/commands/ls/ls_entity.rb, line 9
def initialize(opts)
  @interrogatee = opts[:interrogatee]
  @no_user_opts = opts[:no_user_opts]
  @opts = opts[:opts]
  @args = opts[:args]
  @grep = Grep.new(Regexp.new(opts[:opts][:G] || '.'))
  @pry_instance = opts.delete(:pry_instance)
end

Public Instance Methods

entities_table() click to toggle source
# File lib/pry/commands/ls/ls_entity.rb, line 18
def entities_table
  entities.map(&:write_out).select { |o| o }.join('')
end

Private Instance Methods

constants() click to toggle source
# File lib/pry/commands/ls/ls_entity.rb, line 32
def constants
  grep Constants.new(@interrogatee, @no_user_opts, @opts, pry_instance)
end
entities() click to toggle source
# File lib/pry/commands/ls/ls_entity.rb, line 56
def entities
  [
    globals, constants, methods, self_methods, instance_vars, local_names,
    local_vars
  ]
end
globals() click to toggle source
# File lib/pry/commands/ls/ls_entity.rb, line 28
def globals
  grep Globals.new(@opts, pry_instance)
end
grep(entity) click to toggle source
# File lib/pry/commands/ls/ls_entity.rb, line 24
def grep(entity)
  entity.tap { |o| o.grep = @grep }
end
instance_vars() click to toggle source
# File lib/pry/commands/ls/ls_entity.rb, line 44
def instance_vars
  grep InstanceVars.new(@interrogatee, @no_user_opts, @opts, pry_instance)
end
local_names() click to toggle source
# File lib/pry/commands/ls/ls_entity.rb, line 48
def local_names
  grep LocalNames.new(@no_user_opts, @args, pry_instance)
end
local_vars() click to toggle source
# File lib/pry/commands/ls/ls_entity.rb, line 52
def local_vars
  LocalVars.new(@opts, pry_instance)
end
methods() click to toggle source
# File lib/pry/commands/ls/ls_entity.rb, line 36
def methods
  grep(Methods.new(@interrogatee, @no_user_opts, @opts, pry_instance))
end
self_methods() click to toggle source
# File lib/pry/commands/ls/ls_entity.rb, line 40
def self_methods
  grep SelfMethods.new(@interrogatee, @no_user_opts, @opts, pry_instance)
end