I am using Pry under Ruby 2.5 to debug a problem within a base class (Net::HTTP
)
I am getting an exception caused by an HTTP 404 response and I want to examine the body of the request that was made. To do this I want to inspect the block which was passed to start
, but the start
method does not have a parameter, it's called using yield
:
Frame type: method
From: /usr/share/ruby/net/http.rb @ line 910 Net::HTTP#start:
905: def start # :yield: http
906: raise IOError, 'HTTP session already opened' if @started
907: if block_given?
908: begin
909: do_start
=> 910: return yield(self)
Using Pry is there any way to view the source of a block, if that block is not passed in a &block
parameter?
Saw Printing the source code of a Ruby block but it doesn't help me because I don't have a method parameter to use here.