Class: Pry::Command::Ls::SelfMethods
- Includes:
- Interrogatable, MethodsHelper
- Defined in:
- lib/pry/commands/ls/self_methods.rb
Instance Attribute Summary
Attributes inherited from Formatter
Instance Method Summary collapse
-
#initialize(interrogatee, no_user_opts, opts, _pry_) ⇒ SelfMethods
constructor
A new instance of SelfMethods.
- #output_self ⇒ Object
Methods inherited from Formatter
Constructor Details
#initialize(interrogatee, no_user_opts, opts, _pry_) ⇒ SelfMethods
Returns a new instance of SelfMethods.
10 11 12 13 14 |
# File 'lib/pry/commands/ls/self_methods.rb', line 10 def initialize(interrogatee, no_user_opts, opts, _pry_) super(_pry_) @interrogatee = interrogatee @no_user_opts = no_user_opts end |
Instance Method Details
#output_self ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/pry/commands/ls/self_methods.rb', line 16 def output_self methods = all_methods(true).select do |m| m.owner == @interrogatee && grep.regexp[m.name] end heading = "#{ Pry::WrappedModule.new(@interrogatee).method_prefix }methods" output_section(heading, format(methods)) end |