gotransverse-tract-api 0.6.5 → 0.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/gotransverse-tract-api.rb +5 -3
- data/lib/gotransverse-tract-api/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25f10860ad89fa5f3dae30427dd15979a337ecb2
|
4
|
+
data.tar.gz: 1e2e57e4dcf799e18879e571776ca56565f5b641
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 340b5deaf83bdc7765ead44857e7952bd8039dae0fd87dd2e0c4f7bbec0b2a27e31ed59a52900916a1f589488ea005049dccffa51fe8ef0b7f937366d2695887
|
7
|
+
data.tar.gz: 7b2f19a942804c34bd7d3fc1b1cd1bad3993a935b2c775b3a4fbe8630c55eb9e561795340a8f489066cb428cf48aed7e4c1b027f8a5a08e3d7333ae220da736d
|
@@ -141,7 +141,6 @@ module GoTransverseTractApi
|
|
141
141
|
def self.get_response_for(klass, api_params={})
|
142
142
|
|
143
143
|
api_url = GoTransverseTractApi.get_api_url_for(klass)
|
144
|
-
pp "api_url: " + api_url
|
145
144
|
|
146
145
|
if GoTransverseTractApi.configuration.cache_enabled
|
147
146
|
return self.get_cached_response_from(klass, api_params)
|
@@ -269,13 +268,16 @@ module GoTransverseTractApi
|
|
269
268
|
when :put
|
270
269
|
response = http_client.put(api_url, request_body, api_params)
|
271
270
|
when :delete
|
272
|
-
|
271
|
+
api_url = api_url + "/#{api_params[:eid]}"
|
272
|
+
response = http_client.delete(api_url, request_body, {'Content-Type' => 'application/xml', 'Accept' => 'application/xml'})
|
273
273
|
end
|
274
274
|
|
275
|
+
return nil unless response.body.to_s.present?
|
276
|
+
|
275
277
|
xml_response = Nokogiri::XML(response.body.to_s)
|
276
278
|
|
277
279
|
klass = klass.to_s.split("::").last
|
278
|
-
hsh = Hash.from_xml(xml_response.to_s).recursive_symbolize_keys!
|
280
|
+
hsh = Hash.from_xml(xml_response.to_s).recursive_symbolize_keys!
|
279
281
|
|
280
282
|
if method == :get
|
281
283
|
hsh = hsh[klass.pluralize.camelize(:lower).to_sym] rescue Hash.from_xml(xml_response.to_s)[klass.camelize(:lower).to_sym]
|