Class: Pry::Command::Ls::LsEntity
- Defined in:
- lib/pry/commands/ls/ls_entity.rb
Instance Attribute Summary collapse
-
#pry_instance ⇒ Object
readonly
Returns the value of attribute pry_instance.
Instance Method Summary collapse
- #constants ⇒ Object private
- #entities ⇒ Object private
- #entities_table ⇒ Object
- #globals ⇒ Object private
- #grep(entity) ⇒ Object private
-
#initialize(opts) ⇒ LsEntity
constructor
A new instance of LsEntity.
- #instance_vars ⇒ Object private
- #local_names ⇒ Object private
- #local_vars ⇒ Object private
- #methods ⇒ Object private
- #self_methods ⇒ Object private
Constructor Details
#initialize(opts) ⇒ LsEntity
Returns a new instance of LsEntity.
9 10 11 12 13 14 15 16 |
# 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 |
Instance Attribute Details
#pry_instance ⇒ Object (readonly)
Returns the value of attribute pry_instance.
7 8 9 |
# File 'lib/pry/commands/ls/ls_entity.rb', line 7 def pry_instance @pry_instance end |
Instance Method Details
#constants ⇒ Object (private)
32 33 34 |
# File 'lib/pry/commands/ls/ls_entity.rb', line 32 def constants grep Constants.new(@interrogatee, @no_user_opts, @opts, pry_instance) end |
#entities ⇒ Object (private)
56 57 58 59 60 61 |
# File 'lib/pry/commands/ls/ls_entity.rb', line 56 def entities [ globals, constants, methods, self_methods, instance_vars, local_names, local_vars ] end |
#entities_table ⇒ Object
18 19 20 |
# File 'lib/pry/commands/ls/ls_entity.rb', line 18 def entities_table entities.map(&:write_out).select { |o| o }.join('') end |
#globals ⇒ Object (private)
28 29 30 |
# File 'lib/pry/commands/ls/ls_entity.rb', line 28 def globals grep Globals.new(@opts, pry_instance) end |
#grep(entity) ⇒ Object (private)
24 25 26 |
# File 'lib/pry/commands/ls/ls_entity.rb', line 24 def grep(entity) entity.tap { |o| o.grep = @grep } end |
#instance_vars ⇒ Object (private)
44 45 46 |
# 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 ⇒ Object (private)
48 49 50 |
# 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 ⇒ Object (private)
52 53 54 |
# File 'lib/pry/commands/ls/ls_entity.rb', line 52 def local_vars LocalVars.new(@opts, pry_instance) end |
#methods ⇒ Object (private)
36 37 38 |
# 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 ⇒ Object (private)
40 41 42 |
# File 'lib/pry/commands/ls/ls_entity.rb', line 40 def self_methods grep SelfMethods.new(@interrogatee, @no_user_opts, @opts, pry_instance) end |