soap-response_cutter 0.0.4 → 0.0.5

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
  SHA1:
3
- metadata.gz: c00c69445799398a9a6b6eef6c412b2e86a2569d
4
- data.tar.gz: a9e3e7c8824ea9e923989a20dd47533609e6f559
3
+ metadata.gz: 3cd6a7a9f6c652e3b2118c7dfab973f0b07aefd6
4
+ data.tar.gz: 5c34f392618acb23dfbb84f5d45dbb35faf0f2a1
5
5
  SHA512:
6
- metadata.gz: af666b1f590b9d229269e225ec9a38396bf253aabae627f24fd0f3e2a33116d8c1562d1dd0ccbb27e757720ca618cf82da0324516e0ab96eb3d07dcd6abba477
7
- data.tar.gz: b14418e84a7fe1600e2d9eb297050d46732c27d4a8353257971a91431f5120aeb3beca6d881adbb423f3f5271d52c80340b535d9ed7fc07b187127ea5d65233e
6
+ metadata.gz: 848141016968645738a1ba0983dbe3170ba55ab91de2f1bbbb4ea924b0d503ad6676aa984aeebe4b41ed16d9b8ecdc110940e8968103258e43defb750a2bf66f
7
+ data.tar.gz: b1569969b165791cbd500c9d6dfaf231f5248e927c266971e8c807a7b6ab9367fbde2d4b81f5a7ba756ef3626b256033ca143c6c3a5677da1b6953d6ae7d25f7
@@ -1,6 +1,6 @@
1
1
  module Soap
2
2
  # nodoc
3
3
  class ResponseCutter
4
- VERSION = '0.0.4'
4
+ VERSION = '0.0.5'
5
5
  end
6
6
  end
@@ -27,20 +27,27 @@ module Soap
27
27
  fail DeepShit, "#{response} could not be parsed" if safe_guard > 3
28
28
  end
29
29
  end
30
- response
30
+ response || true
31
31
  end
32
32
 
33
33
  private
34
34
 
35
+ # rubocop:disable AbcSize
35
36
  def flatten_response
36
37
  USELESS_KEYS.each do |suffix|
37
38
  @response = response.fetch(key(suffix)) do
38
39
  response.fetch(reverse_key(suffix)) { response }
39
40
  end
40
41
  throw :done unless response.is_a?(Hash)
42
+ clear_xmlns_keys
41
43
  throw :done unless useless_nesting?
42
44
  end
43
45
  end
46
+ # rubocop:enable AbcSize
47
+
48
+ def clear_xmlns_keys
49
+ response.delete_if { |k| k.to_s =~ /xmlns/ }
50
+ end
44
51
 
45
52
  def useless_nesting?
46
53
  response.any? { |k| k.to_s =~ /response|result|return/ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soap-response_cutter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikael Henriksson