result_vault 1.2.3 → 1.4.0

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: cc62221bda4ff92f32af12135f1e99b44a85c0960494b3daad9d727dbc7f78f0
4
- data.tar.gz: c2d5f53c3919a4eca97a89e1c11d1e89167eff80b5de6d5f94595d9e7d398b4c
3
+ metadata.gz: e2c6587cbfbd12ff165958681c553afd1fad5dc68a87e92443f03e36fe129bcb
4
+ data.tar.gz: 8e33859a33f63b3efb7eb7de5fd82051a4bc2692a1ab93bd559c7d8bd919efb8
5
5
  SHA512:
6
- metadata.gz: 5a6028e1dbc8910a763ddc914f2261280d1d8371747ff480e028774048735620bdf695be5bd9d2c0067582c421b739a96e80d7332a5a4bc250b3ddb669a55ba1
7
- data.tar.gz: dea5c853880da64aca0e40924960c7787b77c68f80c718a6f0f7875e50b574c3422cd526f2828ff5f038919d2632d674ed17bcaee0f368a0a7caecf2aa2ca7d0
6
+ metadata.gz: 78fc0379ff394e3d9b8cdcc86ffaeb751fb2f1bee93c15759c49f8a9cf93e17784a8e005d0b0dfe4875dd1b28264bab7c13b57088c296dbbacdb612d4b9c0af6
7
+ data.tar.gz: 00f9ee100a107399f8564ed7f04fd4387f86313142a822b130d9a755280ced027d7ea2f98bfcb1c66802af619caab66121e02dff70df2c45389c9f4446228ba4
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class ResultVault
4
- VERSION = "1.2.3"
4
+ VERSION = '1.4.0'
5
5
  end
data/lib/result_vault.rb CHANGED
@@ -110,11 +110,29 @@ class ResultVault
110
110
  end
111
111
 
112
112
 
113
+ ##
114
+ # Set multiple data in a single call
115
+ #
116
+ # @param [Hash] args
117
+ #
118
+ def update(**args)
119
+ args.each do |k, v|
120
+ if k.is_a?(Symbol)
121
+ send("#{k.downcase}=", v)
122
+ else
123
+ fail ArgumentError, ":update argument key not a Symbol: '#{k}'."
124
+ end
125
+ end
126
+
127
+ return self
128
+ end
129
+
130
+
113
131
  ##
114
132
  # Raise an exception if the user is setting data directly
115
133
  #
116
134
  def data=(*)
117
- fail ArgumentError, ":data is a reserved keyword and may not be set directly."
135
+ fail ArgumentError, "use :update to set or update results."
118
136
  end
119
137
 
120
138
 
@@ -202,7 +220,8 @@ class ResultVault
202
220
 
203
221
  when :exception
204
222
  _assert_valid_exception(val)
205
- @exception = val
223
+ @exception = val
224
+ @error_message = exception.to_s if [nil, ""].include?(@error_message)
206
225
 
207
226
  when :success, :ok, :good, :pass, :passed, :succeeded
208
227
  @success = !!val
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: result_vault
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.3
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - CodeMeister
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-25 00:00:00.000000000 Z
11
+ date: 2024-08-13 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: " When your method needs to return more than a single value, ResultVault
14
14
  is a pure ruby solution that lets you add all the extra bits you need while
@@ -43,7 +43,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
43
43
  - !ruby/object:Gem::Version
44
44
  version: '0'
45
45
  requirements: []
46
- rubygems_version: 3.5.5
46
+ rubygems_version: 3.5.17
47
47
  signing_key:
48
48
  specification_version: 4
49
49
  summary: When your method needs to return more than a single value.