grand_central 0.4.5 → 0.5.0
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/grand_central/action.rb +12 -8
- data/lib/grand_central/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4bab60b41f78d368a46d6f5f50411b9ff3e4c1e1
|
4
|
+
data.tar.gz: 162f18b085499204b190ed07b4b12e3fec03e538
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f2abc49d9c520540967964f8c6f7badf979c80ec322dba655e69f8fcc8d9ff063d2b867cb1b47f5bdf8954c935a157ed2083f01f95b336af5452c459cb0c0f7
|
7
|
+
data.tar.gz: 0e9922a471ad8e7392f48b68bec976edb67b1ea13867cf6b87436baaabee01ed3ee98727a940613d1ae47b3dbc58ddf8bdcc949dbbcfc8696bdf33597ef134ec
|
data/lib/grand_central/action.rb
CHANGED
@@ -46,7 +46,7 @@ module GrandCentral
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def self.[](*args)
|
49
|
-
DelayedDispatch.new(self,
|
49
|
+
DelayedDispatch.new(self, args)
|
50
50
|
end
|
51
51
|
|
52
52
|
def self.to_proc
|
@@ -62,24 +62,28 @@ module GrandCentral
|
|
62
62
|
# created and dispatched to the specified store.
|
63
63
|
#
|
64
64
|
# If you're familiar with functional programming, this is really just a
|
65
|
-
# curried `Action.call`,
|
65
|
+
# curried `Action.call`, except the invocation is explicit rather than
|
66
|
+
# happening automatically when all of the arguments have been received.
|
66
67
|
class DelayedDispatch
|
67
|
-
def initialize action_class,
|
68
|
+
def initialize action_class, args
|
68
69
|
@action_class = action_class
|
69
|
-
@store = store
|
70
70
|
@args = args
|
71
|
+
end
|
71
72
|
|
73
|
+
def call *args
|
72
74
|
if store.nil?
|
73
75
|
raise ArgumentError, "No store set for #{action_class}"
|
74
76
|
end
|
75
|
-
end
|
76
77
|
|
77
|
-
|
78
|
-
@store.dispatch @action_class.new(*handle_bowser_event(@args + args))
|
78
|
+
store.dispatch @action_class.new(*handle_bowser_event(@args + args))
|
79
79
|
end
|
80
80
|
|
81
81
|
def [] *args
|
82
|
-
self.class.new @action_class, @
|
82
|
+
self.class.new @action_class, @args + args
|
83
|
+
end
|
84
|
+
|
85
|
+
def store
|
86
|
+
@action_class.store
|
83
87
|
end
|
84
88
|
|
85
89
|
def to_proc
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grand_central
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jamie Gaskins
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|