credova 0.1.8 → 0.1.9

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: 6160ea02df46ba9763039d59ba0e830751de8a6f1690502ae2517cd088da7aa2
4
- data.tar.gz: 1dbbac5c77a59dc687e214ee1e26c7f39056963c6de3da34f02e633f07808aba
3
+ metadata.gz: 68bc96d04f1b8144884f4921b77a5796e9392e26596247081dc866462d1c5ff0
4
+ data.tar.gz: 7a88000202ed805d4a50912c358b833d53dbe62631207749fc18b7bf06c36a6e
5
5
  SHA512:
6
- metadata.gz: b4bc3b0004e98909c525d200e92729e13f2287b2f18b3f5311d01e1235a304194c33f07502013c95cf2f578df7b8ae1d12658a3c9efc67bf8a95be2889f26326
7
- data.tar.gz: c356d3d1a6f1f946399e2bb03b7dd18034f02bc2cb5c55fd498e13a78fbdc15ffc9699a9a37d72dba888d089e6ef37e6bfe11c2e45874b23f6c7dcc674a66a75
6
+ metadata.gz: d03f80ec3327370276cddb9459300f903660dc73fd60a173022b2404bff44fbc02cb7134aa5463e156a36bf65678664c2a577ec361c2e89603d92824850c2203
7
+ data.tar.gz: cbce41558061ab53b242b08540d8d49dd2432ceffb268e958fda1814dda9552f26164e069cbe5cb2356184608dccb038609562bddf36eb8079abf2f108000bee
@@ -66,10 +66,11 @@ module Credova
66
66
  file_name[(file_name.rindex('.') + 1)..-1]
67
67
  end
68
68
 
69
- def standardize_body_data!(submitted_data, permitted_data_attrs)
70
- submitted_data.
71
- select! { |k, v| permitted_data_attrs.include?(k) }.
72
- deep_transform_keys! { |k| k.to_s.camelize(:lower) }
69
+ def standardize_body_data(submitted_data, permitted_data_attrs)
70
+ _submitted_data = submitted_data.deep_transform_keys(&:to_sym)
71
+ permitted_data = (_submitted_data.select! { |k, v| permitted_data_attrs.include?(k) } || _submitted_data)
72
+
73
+ permitted_data.deep_transform_keys { |k| k.to_s.camelize(:lower) }
73
74
  end
74
75
 
75
76
  end
@@ -41,7 +41,7 @@ module Credova
41
41
 
42
42
  headers['Callback-Url'] = callback_url if callback_url.present?
43
43
 
44
- standardize_body_data!(application_data, CREATE_ATTRS[:permitted])
44
+ application_data = standardize_body_data(application_data, CREATE_ATTRS[:permitted])
45
45
 
46
46
  post_request(endpoint, application_data, headers)
47
47
  end
@@ -67,7 +67,7 @@ module Credova
67
67
  *content_type_header('application/json'),
68
68
  ].to_h
69
69
 
70
- standardize_body_data!(delivery_data, SET_DELIVERY_INFORMATION_ATTRS[:permitted])
70
+ delivery_data = standardize_body_data(delivery_data, SET_DELIVERY_INFORMATION_ATTRS[:permitted])
71
71
 
72
72
  post_request(endpoint, delivery_data, headers)
73
73
  end
@@ -29,7 +29,7 @@ module Credova
29
29
  *content_type_header('application/json'),
30
30
  ].to_h
31
31
 
32
- standardize_body_data!(ffl_data, CREATE_ATTRS[:permitted])
32
+ ffl_data = standardize_body_data(ffl_data, CREATE_ATTRS[:permitted])
33
33
 
34
34
  post_request(endpoint, ffl_data, headers)
35
35
  end
@@ -1,3 +1,3 @@
1
1
  module Credova
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.9"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: credova
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeffrey Dill