lib/novaposhta_api/resource.rb in novaposhta_api-0.1.7 vs lib/novaposhta_api/resource.rb in novaposhta_api-0.1.8
- old
+ new
@@ -2,19 +2,15 @@
module NovaposhtaApi
class Resource
attr_reader :http
- HTTP_METHODS = %i[get post patch put delete].freeze
-
def initialize(http: nil)
@http = http
end
- HTTP_METHODS.each do |http_method|
- define_method http_method do |*args|
- response = http.request(http_method, *args)
- response['data']
- end
+ def request(*args)
+ response = http.post(*args)
+ response['data']
end
end
end