rooibos 0.7.2 → 0.7.3
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/rooibos/router.rb +16 -16
- data/lib/rooibos/version.rb +1 -1
- 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: 62b5746b5691433de9604aed2deb6e083f5af45510123545831ad594b9b5c3da
|
|
4
|
+
data.tar.gz: 8d007372dd8abf556f83b1ab40d70139cc2c407d22f317b550bfc760b8d7080d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 447fa181daa6eb2fff6470154bbb2a4ee94ec3fb8a2876b2a9a52e8093d098257c87e5c464fbcee87aace83d0323fa0aba7fc0961220c10f1230d62c051fd0b5
|
|
7
|
+
data.tar.gz: e654c9118df85fd0332a4b6664de6d359d7ff0dfc241415abee1508584d7b9f95d8f4dcf1f25c8ee71b5f492ac796e2355c0f319e4d24abc28599b3f7588f92b
|
data/lib/rooibos/router.rb
CHANGED
|
@@ -165,22 +165,6 @@ module Rooibos
|
|
|
165
165
|
routes.add(Route.new(prefix: prefix&.to_s&.to_sym, fragment: to, read:, write:))
|
|
166
166
|
end
|
|
167
167
|
|
|
168
|
-
# Forwards all instances of a class to routes.
|
|
169
|
-
#
|
|
170
|
-
# Matches messages by class. Ideal for custom message types or
|
|
171
|
-
# RatatuiRuby event classes like <tt>Event::Resize</tt>.
|
|
172
|
-
#
|
|
173
|
-
# Use <tt>broadcast: true</tt> to send to all declared routes, or
|
|
174
|
-
# <tt>broadcast_to:</tt> with an array of specific route targets.
|
|
175
|
-
#
|
|
176
|
-
# === Example
|
|
177
|
-
#
|
|
178
|
-
# forward_instances_of RatatuiRuby::Event::Resize, to: :main_layout
|
|
179
|
-
# forward_instances_of ThemeChanged, broadcast: true
|
|
180
|
-
def forward_instances_of(klass, ...)
|
|
181
|
-
forwards.add_instances_of(klass, ...)
|
|
182
|
-
end
|
|
183
|
-
|
|
184
168
|
# Defines a named action referenceable by symbol.
|
|
185
169
|
#
|
|
186
170
|
# Actions are reusable handlers. Reference them by name in
|
|
@@ -322,6 +306,22 @@ module Rooibos
|
|
|
322
306
|
forwards.add_events(keys, to:, **)
|
|
323
307
|
end
|
|
324
308
|
|
|
309
|
+
# Forwards all instances of a class to routes.
|
|
310
|
+
#
|
|
311
|
+
# Matches messages by class. Ideal for custom message types or
|
|
312
|
+
# RatatuiRuby event classes like <tt>Event::Resize</tt>.
|
|
313
|
+
#
|
|
314
|
+
# Use <tt>broadcast: true</tt> to send to all declared routes, or
|
|
315
|
+
# <tt>broadcast_to:</tt> with an array of specific route targets.
|
|
316
|
+
#
|
|
317
|
+
# === Example
|
|
318
|
+
#
|
|
319
|
+
# forward_instances_of RatatuiRuby::Event::Resize, to: :main_layout
|
|
320
|
+
# forward_instances_of ThemeChanged, broadcast: true
|
|
321
|
+
def forward_instances_of(klass, to: @_scoped_target, **)
|
|
322
|
+
forwards.add_instances_of(klass, to:, **)
|
|
323
|
+
end
|
|
324
|
+
|
|
325
325
|
# Routes matching routed messages to a declared route.
|
|
326
326
|
#
|
|
327
327
|
# Matches <tt>Message::Routed</tt> messages by envelope. Use this
|
data/lib/rooibos/version.rb
CHANGED