diff options
author | h7kayama <0hideki0@gmail.com> | 2021-11-25 16:40:31 +0900 |
---|---|---|
committer | h7kayama <0hideki0@gmail.com> | 2021-11-25 16:40:31 +0900 |
commit | 5ec0c0b962acf9b86430220e65aa2d2f6c580166 (patch) | |
tree | 9d08b40525b315545c15df95207a0040b9f9a6a3 /README.md | |
parent | 5590e095ae97bfed0374ee0e1f58a78dae855d8f (diff) | |
download | pry-5ec0c0b962acf9b86430220e65aa2d2f6c580166.tar.gz |
update readme: Removed method is used in the example
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 26 |
1 files changed, 13 insertions, 13 deletions
@@ -267,23 +267,23 @@ syntax and also simply the name of a method that's in scope. You can optionally pass the `-l` option to `show-source` to include line numbers in the output. In the following example we will enter the `Pry` class, list the instance -methods beginning with 're' and display the source code for the `rep` method: +methods beginning with 're' and display the source code for the `repl` method: ```ruby pry(main)> cd Pry pry(Pry):1> ls -M --grep re -Pry#methods: re readline refresh rep repl repl_epilogue repl_prologue retrieve_line -pry(Pry):1> show-source rep -l - -From: /home/john/ruby/projects/pry/lib/pry/pry_instance.rb:143 -Number of lines: 6 - -143: def rep(target=TOPLEVEL_BINDING) -144: target = Pry.binding_for(target) -145: result = re(target) -146: -147: show_result(result) if should_print? -148: end +Pry#methods: current_binding current_context last_result last_result= last_result_is_exception? repl reset_eval_string set_last_result show_result suppress_output suppress_output= +pry(Pry):1> show-source repl -l + +From: /home/john/ruby/projects/pry/lib/pry/pry_instance.rb:279: +Owner: Pry +Visibility: public +Signature: repl(target=?) +Number of lines: 3 + +279: def repl(target = nil) +280: Pry::REPL.new(self, target: target).start +281: end ``` Note that we can also view C methods (from Ruby Core) using the |