trailblazer-activity 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bed08027bb74c9466a7dee0325bf2eb5fddc637eb2e46f3f86a3292e522fe083
|
4
|
+
data.tar.gz: 3a89ef72fbbb55f084779cb376f68ef542486d4a5b0fe8af1200e594fea6f6b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c221eba23024d176d6c6c3376fd3aa6c5a668806d3b2cccd09e7a85496a07c833dddb74fa30e6c346eb0e8093b8186f1f8cc1557a21a37f1feddb7a9fabd7a9
|
7
|
+
data.tar.gz: 27e679eab5c94988e821e05a7bdb25c301e656091f8bc100bb84a142cec3ec0f7fced3c61bb7ef0d5b2e89cd0847d22e7db2ca17c783906316628216dad93e12
|
data/CHANGES.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
module Trailblazer
|
2
2
|
class Activity < Module # End event is just another callable task.
|
3
|
+
# Builds an Activity::End instance.
|
4
|
+
def self.End(semantic)
|
5
|
+
End.new(semantic: semantic)
|
6
|
+
end
|
3
7
|
|
4
8
|
# Any instance of subclass of End will halt the circuit's execution when hit.
|
5
9
|
|
@@ -7,10 +11,25 @@
|
|
7
11
|
# in an activity. The special behavior is that it
|
8
12
|
# a) maintains a semantic that is used to further connect that very event
|
9
13
|
# b) its `End#call` method returns the end instance itself as the signal.
|
10
|
-
End
|
14
|
+
class End
|
15
|
+
def initialize(semantic:, **options)
|
16
|
+
@options = options.merge(semantic: semantic)
|
17
|
+
end
|
18
|
+
|
11
19
|
def call(*args)
|
12
20
|
return self, *args
|
13
21
|
end
|
22
|
+
|
23
|
+
def to_h
|
24
|
+
@options
|
25
|
+
end
|
26
|
+
|
27
|
+
def inspect
|
28
|
+
to_s
|
29
|
+
end
|
30
|
+
def to_s
|
31
|
+
%{#<#{self.class.name} #{@options.collect{ |k,v| "#{k}=#{v.inspect}" }.join(" ")}>}
|
32
|
+
end
|
14
33
|
end
|
15
34
|
|
16
35
|
class Start < End
|
@@ -19,11 +38,6 @@
|
|
19
38
|
end
|
20
39
|
end
|
21
40
|
|
22
|
-
# Builds an Activity::End instance.
|
23
|
-
def self.End(semantic)
|
24
|
-
Activity::End.new(semantic)
|
25
|
-
end
|
26
|
-
|
27
41
|
class Signal; end
|
28
42
|
class Right < Signal; end
|
29
43
|
class Left < Signal; end
|