action_sequence 0.0.1 → 0.1.2
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 +4 -4
- data/lib/action_sequence.rb +0 -1
- data/lib/action_sequence/context.rb +7 -3
- data/lib/action_sequence/sequence.rb +8 -4
- metadata +1 -2
- data/lib/action_sequence/transaction_sequence.rb +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ad85b7f3eebc0a5c2643bef6045873a4d2e84a47e1db3883a20935ab1f1bcd1
|
4
|
+
data.tar.gz: 0a5da8930f1027167590d8b50cd552be7d7cc9541d51f99ffa4adb4d598a69d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3680d65056a53ae75733b5e377d82213a53eb16337372fb13150f952a369283ca932cee9d25ee1b1fb084bbd4d0198795a21211ee14ffddc3077e4d725500a1e
|
7
|
+
data.tar.gz: 72b45d91171df7d0ee34522270a53d4e23e9354e8b4c2922d36f577b802f3cc5d92ed2e56888b92a4e19e4fd9df2a673de6205560ea1d66fb349c3f351f4ccbc
|
data/lib/action_sequence.rb
CHANGED
@@ -14,7 +14,7 @@ module ActionSequence
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def add_to_context!(hash)
|
17
|
-
|
17
|
+
context.merge!(hash)
|
18
18
|
end
|
19
19
|
|
20
20
|
def failed?
|
@@ -29,8 +29,12 @@ module ActionSequence
|
|
29
29
|
@error_message = error_message
|
30
30
|
end
|
31
31
|
|
32
|
-
def fetch(key)
|
33
|
-
|
32
|
+
def fetch(key, default)
|
33
|
+
context.fetch(key, default)
|
34
34
|
end
|
35
|
+
|
36
|
+
private
|
37
|
+
|
38
|
+
attr_reader :context
|
35
39
|
end
|
36
40
|
end
|
@@ -12,13 +12,17 @@ module ActionSequence
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def call
|
15
|
-
|
16
|
-
return
|
15
|
+
actions.each do |action|
|
16
|
+
return context if context.failed?
|
17
17
|
|
18
|
-
action.call(
|
18
|
+
action.call(context)
|
19
19
|
end
|
20
20
|
|
21
|
-
|
21
|
+
context
|
22
22
|
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
attr_reader :actions, :context
|
23
27
|
end
|
24
28
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: action_sequence
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James A. Sral
|
@@ -19,7 +19,6 @@ files:
|
|
19
19
|
- lib/action_sequence.rb
|
20
20
|
- lib/action_sequence/context.rb
|
21
21
|
- lib/action_sequence/sequence.rb
|
22
|
-
- lib/action_sequence/transaction_sequence.rb
|
23
22
|
homepage: https://rubygems.org/gems/action_sequence
|
24
23
|
licenses:
|
25
24
|
- MIT
|