lib/httpx/chainable.rb in httpx-0.22.5 vs lib/httpx/chainable.rb in httpx-0.23.0

- old
+ new

@@ -1,13 +1,13 @@ # frozen_string_literal: true module HTTPX module Chainable - %i[head get post put delete trace options connect patch].each do |meth| + %w[head get post put delete trace options connect patch].each do |meth| class_eval(<<-MOD, __FILE__, __LINE__ + 1) - def #{meth}(*uri, **options) # def get(*uri, **options) - request(:#{meth}, uri, **options) # request(:get, uri, **options) - end # end + def #{meth}(*uri, **options) # def get(*uri, **options) + request("#{meth.upcase}", uri, **options) # request("GET", uri, **options) + end # end MOD end def request(*args, **options) branch(default_options).request(*args, **options)