Class: EventStoreRuby::EventQuery
- Inherits:
-
Object
- Object
- EventStoreRuby::EventQuery
- Defined in:
- lib/eventstore_ruby/event_query.rb
Overview
EventQuery represents a logical OR composition of multiple EventFilter instances. An event matches the query if it matches at least one of the contained filters.
Instance Attribute Summary collapse
-
#filters ⇒ Object
readonly
Returns the value of attribute filters.
Instance Method Summary collapse
-
#initialize(filters:) ⇒ EventQuery
constructor
A new instance of EventQuery.
Constructor Details
#initialize(filters:) ⇒ EventQuery
Returns a new instance of EventQuery.
10 11 12 13 14 15 16 17 18 |
# File 'lib/eventstore_ruby/event_query.rb', line 10 def initialize(filters:) unless filters.is_a?(Array) && filters.all? { |f| f.is_a?(EventFilter) } raise ArgumentError, 'filters must be an Array<EventFilter>' end raise ArgumentError, 'filters array cannot be empty' if filters.empty? @filters = filters.freeze freeze end |
Instance Attribute Details
#filters ⇒ Object (readonly)
Returns the value of attribute filters.
8 9 10 |
# File 'lib/eventstore_ruby/event_query.rb', line 8 def filters @filters end |