opera 0.2.17 → 0.2.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +1 -1
- data/README.md +1 -0
- data/lib/opera/operation/instructions/executors/validate.rb +1 -1
- data/lib/opera/operation/result.rb +9 -3
- data/lib/opera/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5f102d05b4d0cbf79d677bc5697388b51f643dfa5a880426894f1c6b30b70dc
|
4
|
+
data.tar.gz: a30d504859167c71b902ac30dbc03bcf8ea048575aa08a5f0b26864e24c51be9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69fe6abf0538339b075da566f75d8b18e60533cb33254bc25a5e495f49e89fa065a2abe2ee65c8e79cbf5b222a68284ac3f6a8a5fb37c9453a5a767d58d9caf1
|
7
|
+
data.tar.gz: 12630548b31111d555ffc9e7e95d2d07d5f6fd919feac47ffab3c152587d700a2f4460f927456242b7a23b414ae37d8a152cb9d0f3cd6ea74276894f3dad385e
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -880,6 +880,7 @@ Opera::Operation::Result.new(output: 'success')
|
|
880
880
|
- failure? - [true, false] - Return true if any error or exception
|
881
881
|
- output - [Anything] - Return Anything
|
882
882
|
- output=(Anything) - Sets content of operation output
|
883
|
+
- output! - Return Anything if Success, raise exception if Failure
|
883
884
|
- add_error(key, value) - Adds new error message
|
884
885
|
- add_errors(Hash) - Adds multiple error messages
|
885
886
|
- add_exception(method, message, classname: nil) - Adds new exception
|
@@ -3,14 +3,14 @@
|
|
3
3
|
module Opera
|
4
4
|
module Operation
|
5
5
|
class Result
|
6
|
+
class OutputError < StandardError; end
|
7
|
+
|
6
8
|
attr_reader :errors, # Acumulator of errors in validation + steps
|
7
9
|
:exceptions, # Acumulator of exceptions in steps
|
8
10
|
:information, # Temporal object to store related information
|
9
11
|
:executions # Stacktrace or Pipe of the methods evaludated
|
10
12
|
|
11
|
-
attr_accessor :output #
|
12
|
-
|
13
|
-
alias to_h output
|
13
|
+
attr_accessor :output # in case of success, it contains the resulting value
|
14
14
|
|
15
15
|
def initialize(output: nil, errors: {})
|
16
16
|
@errors = errors
|
@@ -32,6 +32,12 @@ module Opera
|
|
32
32
|
errors.merge(exceptions)
|
33
33
|
end
|
34
34
|
|
35
|
+
def output!
|
36
|
+
raise OutputError, 'Cannot retrieve output from a Failure.' if failure?
|
37
|
+
|
38
|
+
output
|
39
|
+
end
|
40
|
+
|
35
41
|
# rubocop:disable Metrics/MethodLength
|
36
42
|
def add_error(field, message)
|
37
43
|
@errors[field] ||= []
|
data/lib/opera/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opera
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ProFinda Development Team
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-09-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-validation
|