wolf_core 1.0.87 → 1.0.88

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5ff4be5d8370b933a99e3f8759bfde8f6769a941d25e8b617f7f19008bd462f7
4
- data.tar.gz: e0765d75bb28bb02c2406ac0ef18722f26f3afbedaa3ae19b3670da023ecc216
3
+ metadata.gz: 4c9b18a3bc27663bbadcfb5d14982424574280b16346fd93a63edee396425b44
4
+ data.tar.gz: 7ab5549f523329749819b6ac450d3880bb022c0f6d555b81f919b7ddbbda3214
5
5
  SHA512:
6
- metadata.gz: 73bd114d5f4e9ff4c3912142980325645030883ff898ce62ac3230ca3f3faaaa0281266177411783cd77b6734273f590ad8af11180f0ffefcf008974c11d4732
7
- data.tar.gz: 97e9d0d585f9f4cdefb0f831f391cc45f70307c025328817a2bf08b1a029c44a36b4dfac0faeb050823d1846078910ccbbd664fc6bd11ef4f63be9175fe76042
6
+ metadata.gz: 236260ec58fd951be549cacd1fcf1d326ea5698d50b78fa4a9dd89f1f6382825a3ce9a35518576f8a59ffa076769e823e6dbb75794de6f4026bbabefbf2c56d1
7
+ data.tar.gz: 7598d705a89daabc408cc9e3b96ad0624f2cdfbe3df5173ddd9f36e196c751786c49340f04f45128f86afaa0d1ae8ce13b932917a249d9dbcca3258bc2d6c995
@@ -48,13 +48,13 @@ module WolfCore
48
48
  object
49
49
  else
50
50
  result = self.create(object)
51
- success_key = extract_success_key(object)
51
+ success_key = extract_success_key
52
52
  result.success? ? result.data.send(success_key) : object
53
53
  end
54
54
  end
55
55
 
56
56
  def self.create_all(objects)
57
- success_key = extract_success_key(objects.first)
57
+ success_key = extract_success_key
58
58
  final_array = []
59
59
  objects.each do |object|
60
60
  result = create(object)
@@ -71,7 +71,7 @@ module WolfCore
71
71
  object = self.new(parse_params(params, **kwargs))
72
72
  object.reset_changes
73
73
  if object.valid?
74
- success_key = extract_success_key(object)
74
+ success_key = extract_success_key
75
75
  Result.success(data: { success_key => object })
76
76
  else
77
77
  Result.failure(error: { message: object.errors.full_messages.to_sentence })
@@ -80,8 +80,8 @@ module WolfCore
80
80
  Result.failure(error: { message: e.message, error_type: e.class.to_s })
81
81
  end
82
82
 
83
- def self.extract_success_key(object)
84
- object.class.to_s.split('::').last.underscore
83
+ def self.extract_success_key
84
+ self.to_s.split('::').last.underscore
85
85
  end
86
86
 
87
87
  def self.parse_params(params = {}, **kwargs)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module WolfCore
4
- VERSION = "1.0.87"
4
+ VERSION = "1.0.88"
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.87
4
+ version: 1.0.88
5
5
  platform: ruby
6
6
  authors:
7
7
  - Javier Roncallo