Halp, I think #byebug has me in a hostage situation. Serves me right for attempting to do another active record query when I hit an exception
Weirdness trying to modify #Ruby's default #𝚒𝚗𝚜𝚙𝚎𝚌𝚝 method. If I don't have an #𝚒𝚗𝚜𝚙𝚎𝚌𝚝 method in my #class, I get the usual
"#<𝚌𝚕𝚊𝚜𝚜𝚗𝚊𝚖𝚎:𝚒𝚗𝚜𝚝𝚊𝚗𝚌𝚎 @𝚒𝚟𝚊𝚛=𝚟𝚊𝚕𝚞𝚎, @𝚘𝚝𝚑𝚎𝚛_𝚒𝚟𝚊𝚛=𝚟𝚊𝚕𝚞𝚎>"
But if I define one like this,
def inspect
defval = super
return defval
end
what I get is
"#<𝚌𝚕𝚊𝚜𝚜𝚗𝚊𝚖𝚎:𝚒𝚗𝚜𝚝𝚊𝚗𝚌𝚎 ...>"
And I get anomalous results in the #byebug debugger, defval gets the above result. But if I enter "defval = super" by hand in the debugger, I get the original default output from 𝚒𝚗𝚜𝚙𝚎𝚌𝚝. ?
When debugging #ruby, I always struggled to get #byebug to enter the contents of a block, painstakingly stepping through internal methods and watching out for the yield. If you've ever debugged #Rails and/or callbacks, you'll know this pain.
Today, I learned you can just type `c <line number>` to jump straight into the block while skipping all of the plumbing that yields to it.
:ruby: 🐜 🚫 👍