4 ms·
Drop a debugger statement in above the code in question If you're using Pry as your REPL, you can use Pry's ls and show-source commands to get more of the info
by nitrogen 5y ago
Drop a debugger statement in above the code in question
If you're using Pry as your REPL, you can use Pry's ls and show-source commands to get more of the info you want at once, with less typing. It's basically calling the Ruby introspection methods for you.
ls foo
show-source -d foo.bar
- vidarh 5y ago"pry" is absolutely essential. I often prototype my code with a simple helper script that gives me a function to reload the relevant code, and just "live" in the pry prompt to explore the code as I add it. It's the closest thing you get in Ruby to a Smalltalk environment.