Class: RailsSimpleEventSourcing::EventSearch

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_simple_event_sourcing/event_search.rb

Constant Summary collapse

KEY_VALUE_PATTERN =
/\A([^:]+):(.+)\z/

Instance Method Summary collapse

Constructor Details

#initialize(scope:, event_type: nil, aggregate: nil, query: nil) ⇒ EventSearch

Returns a new instance of EventSearch.



7
8
9
10
11
12
# File 'lib/rails_simple_event_sourcing/event_search.rb', line 7

def initialize(scope:, event_type: nil, aggregate: nil, query: nil)
  @scope = scope
  @event_type = event_type
  @aggregate = aggregate
  @query = query&.strip
end

Instance Method Details

#callObject



14
15
16
17
18
19
# File 'lib/rails_simple_event_sourcing/event_search.rb', line 14

def call
  filter_by_event_type
  filter_by_aggregate
  filter_by_query
  @scope
end