Sha256: acd1d4de132de8042c1f4073dee0ab0d45b7d4ab4ad1faedd0199c80c3bdb37f

Contents?: true

Size: 1.21 KB

Versions: 159

Compression:

Stored size: 1.21 KB

Contents

require 'pry/commands/ls/jruby_hacks'

module Pry::Command::Ls::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::BaseHelpers.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

Version data entries

159 entries across 152 versions & 35 rubygems

Version Path
logstash-output-scalyr-0.2.1.beta vendor/bundle/jruby/2.5.0/gems/pry-0.10.4-java/lib/pry/commands/ls/methods_helper.rb
logstash-output-scalyr-0.2.0 vendor/bundle/jruby/2.5.0/gems/pry-0.10.4-java/lib/pry/commands/ls/methods_helper.rb
logstash-output-scalyr-0.2.0.beta vendor/bundle/jruby/2.5.0/gems/pry-0.10.4-java/lib/pry/commands/ls/methods_helper.rb
logstash-output-scalyr-0.1.26.beta vendor/bundle/jruby/2.5.0/gems/pry-0.10.4-java/lib/pry/commands/ls/methods_helper.rb
logstash-output-scalyr-0.1.25.beta vendor/bundle/jruby/2.5.0/gems/pry-0.10.4-java/lib/pry/commands/ls/methods_helper.rb
logstash-output-scalyr-0.1.24.beta vendor/bundle/jruby/2.5.0/gems/pry-0.10.4-java/lib/pry/commands/ls/methods_helper.rb
logstash-output-scalyr-0.1.23.beta vendor/bundle/jruby/2.5.0/gems/pry-0.10.4-java/lib/pry/commands/ls/methods_helper.rb
logstash-output-scalyr-0.1.22.beta vendor/bundle/jruby/2.5.0/gems/pry-0.10.4-java/lib/pry/commands/ls/methods_helper.rb
logstash-output-scalyr-0.1.21.beta vendor/bundle/jruby/2.5.0/gems/pry-0.10.4-java/lib/pry/commands/ls/methods_helper.rb
logstash-output-scalyr-0.1.20.beta vendor/bundle/jruby/2.5.0/gems/pry-0.10.4-java/lib/pry/commands/ls/methods_helper.rb
logstash-output-scalyr-0.1.19.beta vendor/bundle/jruby/2.5.0/gems/pry-0.10.4-java/lib/pry/commands/ls/methods_helper.rb
logstash-output-scalyr-0.1.18.beta vendor/bundle/jruby/2.5.0/gems/pry-0.10.4-java/lib/pry/commands/ls/methods_helper.rb
logstash-output-scalyr-0.1.17.beta vendor/bundle/jruby/2.5.0/gems/pry-0.10.4-java/lib/pry/commands/ls/methods_helper.rb
logstash-output-scalyr-0.1.16.beta vendor/bundle/jruby/2.5.0/gems/pry-0.10.4-java/lib/pry/commands/ls/methods_helper.rb
logstash-output-scalyr-0.1.15.beta vendor/bundle/jruby/2.5.0/gems/pry-0.10.4-java/lib/pry/commands/ls/methods_helper.rb
logstash-output-scalyr-0.1.14.beta vendor/bundle/jruby/2.5.0/gems/pry-0.10.4-java/lib/pry/commands/ls/methods_helper.rb
logstash-output-scalyr-0.1.13 vendor/bundle/jruby/2.5.0/gems/pry-0.10.4-java/lib/pry/commands/ls/methods_helper.rb
logstash-output-scalyr-0.1.12 vendor/bundle/jruby/2.5.0/gems/pry-0.10.4-java/lib/pry/commands/ls/methods_helper.rb
logstash-output-scalyr-0.1.11.beta vendor/bundle/jruby/2.5.0/gems/pry-0.10.4-java/lib/pry/commands/ls/methods_helper.rb
logstash-output-scalyr-0.1.10.beta vendor/bundle/jruby/2.5.0/gems/pry-0.10.4-java/lib/pry/commands/ls/methods_helper.rb