Tag: apis

Daily Code Reading #24 – RestClient::Response

Yesterday I looked at the Request side of RestClient so I’m reading through the RestClient::Response class today. RestClient::Request#execute returns this response object from it’s #process_result. 1 response = Response.new(Request.decode(res['content-encoding'], res.body), res, args)response = Response.new(Request.decode(res['content-encoding'], res.body), res, args) The Code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 …

Read more

Daily Code Reading #23 – RestClient::Request#execute

After looking at the other RestClient::Resource methods from yesterday, I noticed that they are all almost identical to #get. So today I’m going to dig into the code one level down, RestClient::Request. The Code RestClient::Request#execute 1 2 3 4 5 6 7 module RestClient class Request def self.execute(args, &block) new(args).execute &block end end endmodule RestClient …

Read more