wolf_core 1.0.44 → 1.0.46

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: f471cc3a0fe6c7edb5337e7a4ca93a20df51be516a2ad3393fe5e5838feb04ef
4
- data.tar.gz: c80e218e680bb3b5c78dfa35e7d6b025348b2cd98cf061d2ab0ffb4122bde560
3
+ metadata.gz: 794e2a92f90d3d4ad22f51fed483e17f68643130fd9572320fb066971d0e92e3
4
+ data.tar.gz: bda1a0b2a6fd8d6dcb677d6361de5779f4b969ac83551ce6c7ea954c95851a85
5
5
  SHA512:
6
- metadata.gz: 8210514e684531ab6726d44e111ae43907d9b29069738f734f2523c889258aa7447ef39cce4fb0a4ff0ad83188e0ade7a7ecf645c97968009d7c101184e1c68a
7
- data.tar.gz: 4a3e653007100a08a00e79112ceafac6ec93def7777be3cb964cac237099f52cdf7c45784daa354f9191346311bf255432c0d4c37b5769ff22469eddcc185782
6
+ metadata.gz: b6069da749b4b0acd71a88da45aeb0096eff177aee4757d4c43faabf2d944f7c2232bf04b75028bcaef3ab1a5ac007faa2c8275101771f33204a3f79fa756389
7
+ data.tar.gz: 62c2b45417d6764ff3053212f3f2a65c5da5b059222fee78ed1497784c8fcb9ed07923ea050c03f28db46ba66d82e224245b83e672331bc2509d759de46f7e35
@@ -28,10 +28,13 @@ module WolfCore
28
28
  raise_service_error(result.error.to_h)
29
29
  end
30
30
 
31
- def validate_presence(object, message)
31
+ def validate_presence(object, message, error_data: {})
32
32
  return if object.present?
33
33
 
34
- raise_service_error({ message: message })
34
+ error_data ||= {}
35
+ error_data = error_data.merge({ message: message })
36
+
37
+ raise_service_error(error_data)
35
38
  end
36
39
 
37
40
  def remove_non_permitted_parameters(params, allowed_params)
@@ -110,20 +110,21 @@ module WolfCore
110
110
  end
111
111
  end
112
112
 
113
- def safe_http_patch(url:, headers: {}, query: nil, error_message: nil, title: nil)
114
- response = http_patch(url: url, headers: headers, query: query)
113
+ def safe_http_patch(url:, headers: {}, body: nil, query: nil, error_message: nil, title: nil, error_data: nil)
114
+ response = http_patch(url: url, headers: headers, body: body, query: query)
115
115
  response = parse_http_response(response)
116
116
 
117
- log_object response, title: title if title.present?
117
+ title ||= "safe_http_patch response is"
118
+ log_object response, title: title
118
119
 
119
120
  error_message ||= "Error on safe_http_patch"
120
- validate_http_response(response: response, message: error_message)
121
+ validate_http_response(response: response, message: error_message, error_data: error_data)
121
122
 
122
123
  response
123
124
  end
124
125
 
125
- def http_patch(url:, headers: {}, query: nil)
126
- WolfCore::HttpDataSource.http_patch(url: url, headers: headers, query: query)
126
+ def http_patch(url:, headers: {}, body: nil, query: nil)
127
+ WolfCore::HttpDataSource.http_patch(url: url, headers: headers, query: query, body: body)
127
128
  end
128
129
 
129
130
  def validate_http_response(response:, message:, error_data: nil)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WolfCore
4
- VERSION = "1.0.44"
4
+ VERSION = "1.0.46"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wolf_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.44
4
+ version: 1.0.46
5
5
  platform: ruby
6
6
  authors:
7
7
  - Javier Roncallo