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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 84b4f67bd8240b412f78b91e8e8e52af841e6438694bb51013519d3ba6e28fe7
4
- data.tar.gz: 63ac12eba2aee98ecf595aa948d457babc3533ce66b2d9fa20eee5257e26bcf1
3
+ metadata.gz: 62b5746b5691433de9604aed2deb6e083f5af45510123545831ad594b9b5c3da
4
+ data.tar.gz: 8d007372dd8abf556f83b1ab40d70139cc2c407d22f317b550bfc760b8d7080d
5
5
  SHA512:
6
- metadata.gz: 193556d2bf1093e16c1229162e579113c3d4a75c472cf37c071db593f4d1506405de0c7eaf1bccfcb9b2555335ed304c64d25f1cd08231c7c084a58bfa9ba731
7
- data.tar.gz: a8ab3b783bc7f40527f05b15d7c32e971f70518cb9a4769f5d0312590ff866773debe986dcfb93ab36e8cf61a95dc40f9b91db842557633b36333296ffaf6fbf
6
+ metadata.gz: 447fa181daa6eb2fff6470154bbb2a4ee94ec3fb8a2876b2a9a52e8093d098257c87e5c464fbcee87aace83d0323fa0aba7fc0961220c10f1230d62c051fd0b5
7
+ data.tar.gz: e654c9118df85fd0332a4b6664de6d359d7ff0dfc241415abee1508584d7b9f95d8f4dcf1f25c8ee71b5f492ac796e2355c0f319e4d24abc28599b3f7588f92b
@@ -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
@@ -8,5 +8,5 @@
8
8
  module Rooibos
9
9
  # The version of this gem.
10
10
  # See https://semver.org/spec/v2.0.0.html
11
- VERSION = "0.7.2"
11
+ VERSION = "0.7.3"
12
12
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rooibos
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kerrick Long