Class: Sequent::Test::EventStreamHelpers::Builder
- Inherits:
-
Object
- Object
- Sequent::Test::EventStreamHelpers::Builder
- Defined in:
- lib/sequent/test/event_stream_helpers.rb
Instance Attribute Summary collapse
-
#events ⇒ Object
readonly
Returns the value of attribute events.
Instance Method Summary collapse
-
#initialize(aggregate_id) ⇒ Builder
constructor
A new instance of Builder.
-
#method_missing(name, *args, &block) ⇒ Object
rubocop:disable Style/MissingRespondToMissing.
Constructor Details
#initialize(aggregate_id) ⇒ Builder
Returns a new instance of Builder.
41 42 43 44 |
# File 'lib/sequent/test/event_stream_helpers.rb', line 41 def initialize(aggregate_id) @aggregate_id = aggregate_id @events = [] end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
rubocop:disable Style/MissingRespondToMissing
47 48 49 50 |
# File 'lib/sequent/test/event_stream_helpers.rb', line 47 def method_missing(name, *args, &block) args = prepare_arguments(args) @events << FactoryBot.build(name, *args, &block) end |
Instance Attribute Details
#events ⇒ Object (readonly)
Returns the value of attribute events.
39 40 41 |
# File 'lib/sequent/test/event_stream_helpers.rb', line 39 def events @events end |