Class: PgEventstore::Maintenance
- Inherits:
-
Object
- Object
- PgEventstore::Maintenance
- Defined in:
- lib/pg_eventstore/maintenance.rb
Instance Attribute Summary collapse
- #config ⇒ PgEventstore::Config writeonly
Instance Method Summary collapse
-
#delete_event(event, force: false) ⇒ Boolean
Whether an event was deleted successfully.
-
#delete_stream(stream) ⇒ Boolean
Whether a stream was deleted successfully.
-
#initialize(config) ⇒ Maintenance
constructor
A new instance of Maintenance.
Constructor Details
#initialize(config) ⇒ Maintenance
Returns a new instance of Maintenance.
11 12 13 |
# File 'lib/pg_eventstore/maintenance.rb', line 11 def initialize(config) @config = config end |
Instance Attribute Details
#config=(value) ⇒ PgEventstore::Config
7 8 9 |
# File 'lib/pg_eventstore/maintenance.rb', line 7 def config @config end |
Instance Method Details
#delete_event(event, force: false) ⇒ Boolean
Returns whether an event was deleted successfully.
25 26 27 28 29 |
# File 'lib/pg_eventstore/maintenance.rb', line 25 def delete_event(event, force: false) Commands::DeleteEvent.new( Queries.new(transactions: transaction_queries, maintenance: maintenance_queries) ).call(event, force: force) end |
#delete_stream(stream) ⇒ Boolean
Returns whether a stream was deleted successfully.
17 18 19 20 21 |
# File 'lib/pg_eventstore/maintenance.rb', line 17 def delete_stream(stream) Commands::DeleteStream.new( Queries.new(transactions: transaction_queries, maintenance: maintenance_queries) ).call(stream) end |