For show-doc and show-source
# File lib/pry/default_commands/introspection.rb, line 55 def attempt rank = 0 begin yield(rank) rescue Pry::CommandError raise if rank > (module_object.number_of_candidates - 1) rank += 1 retry end end
# File lib/pry/default_commands/introspection.rb, line 14 def method? !!method_object rescue CommandError false end
# File lib/pry/default_commands/introspection.rb, line 10 def module?(name) self.module_object = Pry::WrappedModule.from_str(name, target) end
# File lib/pry/default_commands/introspection.rb, line 43 def module_start_line(mod, candidate_rank=0) if opts.present?(:'base-one') 1 else mod.candidate(candidate_rank).line end end
# File lib/pry/default_commands/introspection.rb, line 20 def process(name) if module?(name) code_or_doc = process_module elsif method? code_or_doc = process_method else code_or_doc = process_alternatives end render_output(code_or_doc, opts) end
# File lib/pry/default_commands/introspection.rb, line 32 def process_alternatives if args.empty? && internal_binding?(target) mod = target_self.is_a?(Module) ? target_self : target_self.class self.module_object = Pry::WrappedModule(mod) process_module else process_method end end
Generated with the Darkfish Rdoc Generator 2.