Since there may be a lot of Ghost Methods inside a ruby gem, I don\'t think it is a good idea to study the inner mechanism of a ruby gem just by reading
If you are using visual studio code, and you have normal debugging enabled for rails you can just open the gem file you want to debug in VS Code, example:
C:\Ruby26-x64\lib\ruby\gems\2.6.0\gems\devise-4.7.3\app\controllers\devise\registrations_controller.rb
and set a breakpoint with VSCode. It will stop execution on that line.