result_vault 1.3.0 → 1.4.1

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: 6c671fcc654b2656919f94b9552b53ae4e2a479557004b09a5c5e2012cedf3c6
4
- data.tar.gz: 2f995336f27d98253b7347e82182d3b57293e42a9d8b1321f66642d92a93e7c2
3
+ metadata.gz: 456da75c86b61cecc1c20d2fe003a5b3eac448aad419746e2830715fdf22fd8d
4
+ data.tar.gz: 04bb413a3950edb84c1c35c87ff596d55051e647cae1c159b57898a44e8c0c53
5
5
  SHA512:
6
- metadata.gz: 363e3220a079d30749fb5b3d11594073d38dd29427ca5d24def50e89f155b09ad9dc6bfc854a6d5286a95b77561e23752b4dec2391bcbf0b63a05084ae1b013f
7
- data.tar.gz: eace09a16e1d4affd64b22c84611e1be6923ec814e6b4a92369fc099ca6587ce5e83e3441b9311e39356c0e9115726336ec20af5f36f62a7be73d5a50ceab3dc
6
+ metadata.gz: d7bee24e46d0ca7afeeeb6fdb29ef2e2fb2a848df73151f7d84a9f450c3c30ca717af0e52508aa080233fb37a9a65aa2cdc1b561304c3150c1093cf0451f1805
7
+ data.tar.gz: 1ca0c31a7b9a6cc3d43a21f8060c71bb7648c788b473be878ed85337907e5459d9701cc53820066b136da0d6ff6cecf6c10f628f9a90ff3d61d245cc6316d697
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class ResultVault
4
- VERSION = '1.3.0'
4
+ VERSION = '1.4.1'
5
5
  end
data/lib/result_vault.rb CHANGED
@@ -53,7 +53,7 @@ class ResultVault
53
53
  # @return [Symbol, String, *, nil]
54
54
  #
55
55
  def status
56
- @status
56
+ @status ||= nil
57
57
  end
58
58
 
59
59
 
@@ -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
 
metadata CHANGED
@@ -1,18 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: result_vault
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - CodeMeister
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-02-13 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies: []
13
- description: " When your method needs to return more than a single value, ResultVault
14
- is a pure ruby solution that lets you add all the extra bits you need while
15
- still returning a single object. "
12
+ description: " A pure ruby solution for returning multiple values from a single
13
+ method call. ResultVault lets you dynamically add attributes to the result object
14
+ by simply defining them: `result.my_name = 'CodeMeister'`. "
16
15
  email:
17
16
  - result_vault@codemeister.dev
18
17
  executables: []
@@ -28,7 +27,6 @@ metadata:
28
27
  homepage_uri: https://github.com/Rubology/result_vault
29
28
  source_code_uri: https://github.com/Rubology/result_vault
30
29
  changelog_uri: https://github.com/Rubology/result_vault/blob/master/CHANGELOG.md
31
- post_install_message:
32
30
  rdoc_options: []
33
31
  require_paths:
34
32
  - lib
@@ -43,8 +41,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
43
41
  - !ruby/object:Gem::Version
44
42
  version: '0'
45
43
  requirements: []
46
- rubygems_version: 3.5.6
47
- signing_key:
44
+ rubygems_version: 4.0.11
48
45
  specification_version: 4
49
- summary: When your method needs to return more than a single value.
46
+ summary: The easy way to return multiple values from a single method.
50
47
  test_files: []