Class: BoomNats::Router
- Inherits:
-
Object
- Object
- BoomNats::Router
- Defined in:
- lib/boom_nats/router.rb
Instance Method Summary collapse
- #in_queue(name, &block) ⇒ Object
-
#initialize(application) ⇒ Router
constructor
A new instance of Router.
- #setup(&block) ⇒ Object
- #topic(name, klass, options = {}) ⇒ Object
Constructor Details
#initialize(application) ⇒ Router
Returns a new instance of Router.
3 4 5 |
# File 'lib/boom_nats/router.rb', line 3 def initialize(application) @application = application end |
Instance Method Details
#in_queue(name, &block) ⇒ Object
11 12 13 14 15 |
# File 'lib/boom_nats/router.rb', line 11 def in_queue(name, &block) @current_group = name instance_eval(&block) @current_group = nil end |
#setup(&block) ⇒ Object
7 8 9 |
# File 'lib/boom_nats/router.rb', line 7 def setup(&block) instance_eval(&block) end |
#topic(name, klass, options = {}) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/boom_nats/router.rb', line 17 def topic(name, klass, = {}) = { queue: @current_group, ** } RouteTopic.new(@application).setup(name, klass, **) end |