I have seen a style of setting method parameters in a block (for example in Faraday) like this:
conn.post do |req|
req.url '/nigiri'
req.headers['Content-Type'] = 'application/json'
req.body = '{ "name": "Unagi" }'
end
- What is this called?
- How does it work under the hood?