nxt_state_machine 0.1.3 → 0.1.4
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/Gemfile.lock +2 -2
- data/lib/nxt_state_machine/transition.rb +7 -5
- data/lib/nxt_state_machine/transition/factory.rb +1 -1
- data/lib/nxt_state_machine/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: c035f94c9cd82caa184fde21b45cba13ad4791b655a34f8cb5140898f7e0760a
|
4
|
+
data.tar.gz: a7237abef06bf937730f6f848a57e276c82dbf6d605f6a34889303402c498655
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67822ebb580c7398d81e6be7c228fc5de573e3ec757843a8f501ea10e7926ae14b5194ce994e79927a5557bc4bbb200f1d05e9081c470b7ac9a9d202a4cc2f21
|
7
|
+
data.tar.gz: 384e7c4e66c21a3b7fe6a043bc1b8936f6061605a4de0d7788f003b9982f96ecb709954c3988165936a3dad0bcfb82c5c781bc0815070ca9ad43a8d46ba1d354
|
data/Gemfile.lock
CHANGED
@@ -15,16 +15,13 @@ module NxtStateMachine
|
|
15
15
|
|
16
16
|
attr_reader :name, :from, :to, :block, :event
|
17
17
|
|
18
|
-
|
18
|
+
# This triggers the set state method
|
19
|
+
def trigger
|
19
20
|
Callable.new(
|
20
21
|
state_machine.send(set_state_method)
|
21
22
|
).bind(
|
22
23
|
context
|
23
24
|
).call(state_machine.target(context), self)
|
24
|
-
end
|
25
|
-
|
26
|
-
def execute(&block)
|
27
|
-
Transition::Proxy.new(event, state_machine,self, context).call(&block)
|
28
25
|
rescue StandardError => error
|
29
26
|
callback = state_machine.find_error_callback(error, self)
|
30
27
|
raise unless callback
|
@@ -32,6 +29,11 @@ module NxtStateMachine
|
|
32
29
|
Callable.new(callback).bind(context).call(error, self)
|
33
30
|
end
|
34
31
|
|
32
|
+
# This must be used in set_state method to actually execute the transition within the around callback chain
|
33
|
+
def execute(&block)
|
34
|
+
Transition::Proxy.new(event, state_machine,self, context).call(&block)
|
35
|
+
end
|
36
|
+
|
35
37
|
alias_method :with_around_callbacks, :execute
|
36
38
|
|
37
39
|
def run_before_callbacks
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nxt_state_machine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andreas Robecke
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: exe
|
13
13
|
cert_chain: []
|
14
|
-
date: 2020-
|
14
|
+
date: 2020-02-07 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: activesupport
|