action_sequence 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/action_sequence/context.rb +5 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 643762b5a9f63731a563edbdfcc75590b4c3563d1d61250302849e3972849b8d
|
4
|
+
data.tar.gz: 78b612a104cfed8b6ccaccc40e83fa840f6e0c6ae16c5ac73578151aedcd2b6b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0b9b4ac04b6e49d200f92f6f61abd8dd8df1459e438fceb101d37779a7042a639606773086904b443e4674af7f16b4e5546431c401458563b0faf42f10e92f1
|
7
|
+
data.tar.gz: 155a9ff6d1c51a2e91c8d77c98a490f8e4dac5f535ac2e19c4d3ad97689098369443f7098ebac2d0380cd0febf774090e0994f88f2739c5055cd89a8e8f4127d
|
@@ -1,13 +1,18 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'forwardable'
|
4
|
+
|
3
5
|
module ActionSequence
|
4
6
|
###
|
5
7
|
# Context container to hold state for an
|
6
8
|
# Sequence of Actions
|
7
9
|
##
|
8
10
|
class Context
|
11
|
+
extend Forwardable
|
9
12
|
attr_reader :error_message
|
10
13
|
|
14
|
+
def_delegators :@context, :fetch
|
15
|
+
|
11
16
|
def initialize(initial_context: {})
|
12
17
|
@context = initial_context
|
13
18
|
@error_message = nil
|
@@ -29,10 +34,6 @@ module ActionSequence
|
|
29
34
|
@error_message = error_message
|
30
35
|
end
|
31
36
|
|
32
|
-
def fetch(key, default)
|
33
|
-
context.fetch(key, default)
|
34
|
-
end
|
35
|
-
|
36
37
|
private
|
37
38
|
|
38
39
|
attr_reader :context
|