Sha256: 6b50f2c4e9cd25a04114590eb684425749c02c9ce5939dda07ffec626d99cdca

Contents?: true

Size: 1.46 KB

Versions: 6796

Compression:

Stored size: 1.46 KB

Contents

# frozen_string_literal: true

class Pry
  class Command
    class Ls < Pry::ClassCommand
      module MethodsHelper
        include Pry::Command::Ls::JRubyHacks

        private

        # Get all the methods that we'll want to output.
        def all_methods(instance_methods = false)
          methods = if instance_methods || @instance_methods_switch
                      Pry::Method.all_from_class(@interrogatee)
                    else
                      Pry::Method.all_from_obj(@interrogatee)
                    end

          if Pry::Helpers::Platform.jruby? && !@jruby_switch
            methods = trim_jruby_aliases(methods)
          end

          methods.select { |method| @ppp_switch || method.visibility == :public }
        end

        def resolution_order
          if @instance_methods_switch
            Pry::Method.instance_resolution_order(@interrogatee)
          else
            Pry::Method.resolution_order(@interrogatee)
          end
        end

        def format(methods)
          methods.sort_by(&:name).map do |method|
            if method.name == 'method_missing'
              color(:method_missing, 'method_missing')
            elsif method.visibility == :private
              color(:private_method, method.name)
            elsif method.visibility == :protected
              color(:protected_method, method.name)
            else
              color(:public_method, method.name)
            end
          end
        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.149 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/ls/methods_helper.rb
cybrid_api_id_ruby-0.123.149 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/ls/methods_helper.rb
cybrid_api_organization_ruby-0.123.149 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/ls/methods_helper.rb
cybrid_api_bank_ruby-0.123.148 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/ls/methods_helper.rb
cybrid_api_id_ruby-0.123.148 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/ls/methods_helper.rb
cybrid_api_organization_ruby-0.123.148 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/ls/methods_helper.rb
cybrid_api_bank_ruby-0.123.147 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/ls/methods_helper.rb
cybrid_api_organization_ruby-0.123.147 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/ls/methods_helper.rb
cybrid_api_id_ruby-0.123.147 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/ls/methods_helper.rb
ory-client-1.16.2 vendor/bundle/ruby/3.1.0/gems/pry-0.14.2/lib/pry/commands/ls/methods_helper.rb
avalara_sdk-24.12.2 vendor/bundle/ruby/2.7.0/gems/pry-0.13.1/lib/pry/commands/ls/methods_helper.rb
cybrid_api_bank_ruby-0.123.145 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/ls/methods_helper.rb
cybrid_api_organization_ruby-0.123.145 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/ls/methods_helper.rb
cybrid_api_id_ruby-0.123.145 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/ls/methods_helper.rb
cybrid_api_bank_ruby-0.123.144 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/ls/methods_helper.rb
cybrid_api_id_ruby-0.123.144 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/ls/methods_helper.rb
cybrid_api_organization_ruby-0.123.144 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/ls/methods_helper.rb
ory-client-1.16.1 vendor/bundle/ruby/3.1.0/gems/pry-0.14.2/lib/pry/commands/ls/methods_helper.rb
ory-client-1.16.0 vendor/bundle/ruby/3.1.0/gems/pry-0.14.2/lib/pry/commands/ls/methods_helper.rb
cybrid_api_bank_ruby-0.123.143 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/commands/ls/methods_helper.rb