Class: Toggly::SnapshotProviders::Base
- Inherits:
-
Object
- Object
- Toggly::SnapshotProviders::Base
- Defined in:
- lib/toggly/snapshot_providers/base.rb
Overview
Base class for snapshot providers.
Snapshot providers persist feature definitions for offline access and faster startup.
Instance Method Summary collapse
-
#clear ⇒ Object
Clear the snapshot.
-
#exists? ⇒ Boolean
Check if a snapshot exists.
-
#load ⇒ Hash?
Load definitions snapshot.
-
#save(definitions, metadata = {}) ⇒ Object
Save definitions snapshot.
Instance Method Details
#clear ⇒ Object
Clear the snapshot
30 31 32 |
# File 'lib/toggly/snapshot_providers/base.rb', line 30 def clear raise NotImplementedError, "Subclass must implement #clear" end |
#exists? ⇒ Boolean
Check if a snapshot exists
37 38 39 40 41 |
# File 'lib/toggly/snapshot_providers/base.rb', line 37 def exists? !load.nil? rescue StandardError false end |
#load ⇒ Hash?
Load definitions snapshot
23 24 25 |
# File 'lib/toggly/snapshot_providers/base.rb', line 23 def load raise NotImplementedError, "Subclass must implement #load" end |
#save(definitions, metadata = {}) ⇒ Object
Save definitions snapshot
15 16 17 |
# File 'lib/toggly/snapshot_providers/base.rb', line 15 def save(definitions, = {}) raise NotImplementedError, "Subclass must implement #save" end |