class Pry::Command::Ls::Methods - pry-0.10.1 Documentation

# class Pry::Command::Ls::Methods

### Public Class Methods

new(interrogatee, no_user_opts, opts, _pry_) click to toggle source
Calls superclass method Pry::Command::Ls::Formatter.new

    # File lib/pry/commands/ls/methods.rb, line 11
    def initialize(interrogatee, no_user_opts, opts, _pry_)
      super(_pry_)
      @interrogatee = interrogatee
      @no_user_opts = no_user_opts
      @default_switch = opts[:methods]
      @instance_methods_switch = opts['instance-methods']
      @ppp_switch = opts[:ppp]
      @jruby_switch = opts['all-java']
      @quiet_switch = opts[:quiet]
      @verbose_switch = opts[:verbose]
    end

### Public Instance Methods

output_self() click to toggle source

    # File lib/pry/commands/ls/methods.rb, line 23
    def output_self
      methods = all_methods.group_by(&:owner)
      # Reverse the resolution order so that the most useful information
      # appears right by the prompt.
      resolution_order.take_while(&below_ceiling).reverse.map do |klass|
        methods_here = (methods[klass] || []).select { |m| grep.regexp[m.name] }
        heading = "#{ Pry::WrappedModule.new(klass).method_prefix }methods"
        output_section(heading, format(methods_here))
      end.join('')
    end