Sha256: 2d2a70b36d439e4c0c099f829ae4368cb30039b9053dca2a516eb511e2e5bd50

Contents?: true

Size: 1.54 KB

Versions: 6796

Compression:

Stored size: 1.54 KB

Contents

# frozen_string_literal: true

class Pry
  class Command
    class Ls < Pry::ClassCommand
      class LsEntity
        attr_reader :pry_instance

        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

        def entities_table
          entities.map(&:write_out).select { |o| o }.join('')
        end

        private

        def grep(entity)
          entity.tap { |o| o.grep = @grep }
        end

        def globals
          grep Globals.new(@opts, pry_instance)
        end

        def constants
          grep Constants.new(@interrogatee, @no_user_opts, @opts, pry_instance)
        end

        def methods
          grep(Methods.new(@interrogatee, @no_user_opts, @opts, pry_instance))
        end

        def self_methods
          grep SelfMethods.new(@interrogatee, @no_user_opts, @opts, pry_instance)
        end

        def instance_vars
          grep InstanceVars.new(@interrogatee, @no_user_opts, @opts, pry_instance)
        end

        def local_names
          grep LocalNames.new(@no_user_opts, @args, pry_instance)
        end

        def local_vars
          LocalVars.new(@opts, pry_instance)
        end

        def entities
          [
            globals, constants, methods, self_methods, instance_vars, local_names,
            local_vars
          ]
        end
      end
    end
  end
end

Version data entries

6,796 entries across 6,792 versions & 31 rubygems

Version Path
cybrid_api_bank_ruby-0.123.132 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/ls/ls_entity.rb
cybrid_api_id_ruby-0.123.132 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/ls/ls_entity.rb
cybrid_api_organization_ruby-0.123.132 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/ls/ls_entity.rb
cybrid_api_bank_ruby-0.123.131 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/ls/ls_entity.rb
cybrid_api_id_ruby-0.123.131 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/ls/ls_entity.rb
cybrid_api_organization_ruby-0.123.131 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/ls/ls_entity.rb
cybrid_api_bank_ruby-0.123.129 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/ls/ls_entity.rb
cybrid_api_id_ruby-0.123.129 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/ls/ls_entity.rb
cybrid_api_organization_ruby-0.123.129 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/ls/ls_entity.rb
cybrid_api_bank_ruby-0.123.127 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/ls/ls_entity.rb
cybrid_api_id_ruby-0.123.127 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/ls/ls_entity.rb
cybrid_api_organization_ruby-0.123.127 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/ls/ls_entity.rb
cybrid_api_bank_ruby-0.123.126 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/ls/ls_entity.rb
cybrid_api_id_ruby-0.123.126 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/ls/ls_entity.rb
cybrid_api_organization_ruby-0.123.126 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/ls/ls_entity.rb
avalara_sdk-24.12.1 vendor/bundle/ruby/2.7.0/gems/pry-0.13.1/lib/pry/commands/ls/ls_entity.rb
cybrid_api_bank_ruby-0.123.125 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/ls/ls_entity.rb
cybrid_api_organization_ruby-0.123.125 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/ls/ls_entity.rb
cybrid_api_id_ruby-0.123.125 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/ls/ls_entity.rb
cybrid_api_bank_ruby-0.123.124 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/ls/ls_entity.rb