Module: Sequent::Core::SnapshotConfiguration::ClassMethods
- Defined in:
- lib/sequent/core/aggregate_root.rb
Instance Attribute Summary collapse
-
#snapshot_default_threshold ⇒ Object
readonly
Returns the value of attribute snapshot_default_threshold.
Instance Method Summary collapse
-
#enable_snapshots(default_threshold: 20) ⇒ Object
Enable snapshots for this aggregate.
- #snapshots_enabled? ⇒ Boolean
Instance Attribute Details
#snapshot_default_threshold ⇒ Object (readonly)
Returns the value of attribute snapshot_default_threshold.
26 27 28 |
# File 'lib/sequent/core/aggregate_root.rb', line 26 def snapshot_default_threshold @snapshot_default_threshold end |
Instance Method Details
#enable_snapshots(default_threshold: 20) ⇒ Object
Enable snapshots for this aggregate. The aggregate instance must define the load_from_snapshot and save_to_snapshot methods.
18 19 20 |
# File 'lib/sequent/core/aggregate_root.rb', line 18 def enable_snapshots(default_threshold: 20) @snapshot_default_threshold = default_threshold end |
#snapshots_enabled? ⇒ Boolean
22 23 24 |
# File 'lib/sequent/core/aggregate_root.rb', line 22 def snapshots_enabled? !snapshot_default_threshold.nil? end |