Module: Aggro::BindingDSL

Included in:
Projection, Saga
Defined in:
lib/aggro/binding_dsl.rb

Overview

Public: Adds a DSL creating domain event bindings.

Instance Method Summary collapse

Instance Method Details

#bind(ref, filters: default_filters, to: nil, &block) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/aggro/binding_dsl.rb', line 4

def bind(ref, filters: default_filters, to: nil, &block)
  if to
    bindings << Aggro.event_bus.subscribe(ref.id, self, to, filters)
  else
    bind_block ref, filters, &block
  end
end