almapi 0.1.9 → 0.1.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8b5ba5d80ae25614a6560df36126d04a5ab3eb574ce5026ca5b5c8cacddf3a70
4
- data.tar.gz: 26cad93394125cbaa1bfc11c6a9ef20e4dd38366815d59a4a43d21b744e31115
3
+ metadata.gz: a2c71796da8723be199a4befd1fc46e4df4e6f1fc718979982cee53f201302e9
4
+ data.tar.gz: 55c28ae9525298ab9af58716ac1d705860c96ea7244bd4e6725a752ee9da233f
5
5
  SHA512:
6
- metadata.gz: ebef23941dbf9a8b0fc8dbbc1b1ab1496f3bc341aab56329a7f39ca9817270a714feb57adf02a204b97231d70f5a23217d9344a8f1f99ddaadcd469e4c2d7b28
7
- data.tar.gz: aa8a1ec97ab087310cd1c5f428db752ca7f76504bc0b90fdfe07cacba3006337829532c17b36d60d6b8ec71dbb4377e9de6de1e862852921b8e394282e1ec2a7
6
+ metadata.gz: 941deaa4377e68d206081d46c99df0ee2eb35b3dd57d90f2f81518da97264d5c0173f9fa3ea15b4d5679ed698cd9defc18113afa73f4a1d272081d28c3f5cdaa
7
+ data.tar.gz: c3d3ba08d5f450ee06c5f0a0ea360e9128b7446974a5187e0dd6ed666c807ea7ba544635a1348777d954cbd866faff27daa720c552639f6c30f38ddb4bbf5f21
data/lib/almapi/almapi.rb CHANGED
@@ -62,7 +62,7 @@ module Almapi
62
62
  end
63
63
 
64
64
  puts "[Almapi::Api.get] INFO URL #{url_api}"
65
- handle_response(@conn.get(url_api))
65
+ handle_response(@conn.get(url_api), "GET")
66
66
  end
67
67
 
68
68
  # Handles a POST request creating the complete URI.
@@ -74,7 +74,7 @@ module Almapi
74
74
  def post(resource, data)
75
75
  url_api = "#{@uri_base}#{resource}"
76
76
  puts "[Almapi::Api.post] INFO URL #{url_api}"
77
- handle_response(@conn.post(url_api, data.to_s))
77
+ handle_response(@conn.post(url_api, data.to_s), "POST")
78
78
  end
79
79
 
80
80
  # Handles a PUT request creating the complete URI.
@@ -86,7 +86,7 @@ module Almapi
86
86
  def put(resource, data)
87
87
  url_api = "#{@uri_base}#{resource}"
88
88
  puts "[Almapi::Api.put] INFO URL #{url_api}"
89
- handle_response(@conn.put(url_api, data.to_s))
89
+ handle_response(@conn.put(url_api, data.to_s), "PUT")
90
90
  end
91
91
 
92
92
  # Handles a DELETE request creating the complete URI.
@@ -95,10 +95,10 @@ module Almapi
95
95
  # Must not include "?" for it adds "?apikey" automatically.
96
96
  # @param data [String] : an XML string containing data to put.
97
97
  # @return [Response] : the resulting response. If error occurs, raises an AlmapiError
98
- def delete(resource, _data)
98
+ def delete(resource, data)
99
99
  url_api = "#{@uri_base}#{resource}"
100
100
  puts "[Almapi::Api.delete] INFO URL #{url_api}"
101
- handle_response(@conn.delete(url_api))
101
+ handle_response(@conn.delete(url_api), "DELETE")
102
102
  end
103
103
 
104
104
  private
@@ -115,7 +115,8 @@ module Almapi
115
115
  response
116
116
  else
117
117
  # Request has been correctly handled but cannot succeed
118
- raise Almapi::AlmapiError, "[Almapi::Api.handle_response] AlmapiError : for method #{method}, #{response.status} -> #{response.body}"
118
+ raise Almapi::AlmapiError,
119
+ "[Almapi::Api.handle_response] AlmapiError : for method #{method}, #{response.status} -> #{response.body}"
119
120
  end
120
121
  end
121
122
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Almapi
4
- VERSION = "0.1.9"
4
+ VERSION = "0.1.12"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: almapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - jszenb