Sha256: a706edf2612da6e3d5c03aed254c5b8cddd978472bea15466c26bfdb033e4198

Contents?: true

Size: 1.1 KB

Versions: 6796

Compression:

Stored size: 1.1 KB

Contents

# frozen_string_literal: true

class Pry
  module Helpers
    module OptionsHelpers
      module_function

      # Add method options to the Pry::Slop instance
      def method_options(opt)
        @method_target = target
        opt.on :M, "instance-methods", "Operate on instance methods."
        opt.on :m, :methods, "Operate on methods."
        opt.on :s, :super, "Select the 'super' method. Can be repeated to " \
                           "traverse the ancestors.", as: :count
        opt.on(
          :c, :context, "Select object context to run under.", argument: true
        ) do |context|
          @method_target = Pry.binding_for(target.eval(context))
        end
      end

      # Get the method object parsed by the slop instance
      def method_object
        @method_object ||= get_method_or_raise(
          args.empty? ? nil : args.join(" "),
          @method_target,
          super: opts[:super],
          instance: opts.present?(:'instance-methods') && !opts.present?(:methods),
          methods: opts.present?(:methods) && !opts.present?(:'instance-methods')
        )
      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/helpers/options_helpers.rb
cybrid_api_id_ruby-0.123.149 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/helpers/options_helpers.rb
cybrid_api_organization_ruby-0.123.149 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/helpers/options_helpers.rb
cybrid_api_bank_ruby-0.123.148 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/helpers/options_helpers.rb
cybrid_api_id_ruby-0.123.148 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/helpers/options_helpers.rb
cybrid_api_organization_ruby-0.123.148 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/helpers/options_helpers.rb
cybrid_api_bank_ruby-0.123.147 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/helpers/options_helpers.rb
cybrid_api_organization_ruby-0.123.147 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/helpers/options_helpers.rb
cybrid_api_id_ruby-0.123.147 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/helpers/options_helpers.rb
ory-client-1.16.2 vendor/bundle/ruby/3.1.0/gems/pry-0.14.2/lib/pry/helpers/options_helpers.rb
avalara_sdk-24.12.2 vendor/bundle/ruby/2.7.0/gems/pry-0.13.1/lib/pry/helpers/options_helpers.rb
cybrid_api_bank_ruby-0.123.145 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/helpers/options_helpers.rb
cybrid_api_organization_ruby-0.123.145 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/helpers/options_helpers.rb
cybrid_api_id_ruby-0.123.145 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/helpers/options_helpers.rb
cybrid_api_bank_ruby-0.123.144 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/helpers/options_helpers.rb
cybrid_api_id_ruby-0.123.144 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/helpers/options_helpers.rb
cybrid_api_organization_ruby-0.123.144 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/helpers/options_helpers.rb
ory-client-1.16.1 vendor/bundle/ruby/3.1.0/gems/pry-0.14.2/lib/pry/helpers/options_helpers.rb
ory-client-1.16.0 vendor/bundle/ruby/3.1.0/gems/pry-0.14.2/lib/pry/helpers/options_helpers.rb
cybrid_api_bank_ruby-0.123.143 vendor/bundle/ruby/3.3.0/gems/pry-0.14.2/lib/pry/helpers/options_helpers.rb