Module: Memoria
- Extended by:
- Memoria
- Included in:
- Memoria
- Defined in:
- lib/memoria.rb,
lib/memoria/version.rb,
lib/memoria/snapshot.rb,
lib/memoria/configuration.rb,
lib/memoria/rspec/metadata.rb,
lib/memoria/snapshot_saver.rb,
lib/memoria/rspec/configurator.rb,
lib/memoria/rspec/metadata_parser.rb,
lib/memoria/errors/duplicate_setting.rb,
lib/memoria/errors/invalid_record_mode.rb,
lib/memoria/errors/invalid_configuration.rb,
lib/memoria/errors/invalid_snapshot_extension.rb
Overview
Encapsulates and provides access to the public interface of the gem.
Defined Under Namespace
Modules: Errors, RSpec Classes: Configuration, Snapshot, SnapshotSaver
Constant Summary collapse
- VERSION =
'0.1.0'.freeze
Instance Method Summary collapse
-
#configuration ⇒ Configuration
Exposes the gem’s configuration.
-
#configure {|config| ... } ⇒ void
Configures Memoria.
-
#current_snapshot ⇒ Snapshot
The last recorded snapshot.
-
#record(snapshot_name) ⇒ Snapshot
Records a new snapshot.
-
#snapshot_saver ⇒ SnapshotSaver
Returns an entity to persist snapshots (on the file system).
-
#snapshots ⇒ Array<Snapshot>
Returns the list of recorded snapshots.
-
#stop_recording ⇒ Array
Stops recording snapshots.
Instance Method Details
#configuration ⇒ Configuration
Exposes the gem’s configuration.
56 57 58 |
# File 'lib/memoria.rb', line 56 def configuration @configuration ||= Configuration.new end |
#configure {|config| ... } ⇒ void
This method returns an undefined value.
Configures Memoria.
43 44 45 |
# File 'lib/memoria.rb', line 43 def configure yield configuration end |
#current_snapshot ⇒ Snapshot
The last recorded snapshot.
20 21 22 |
# File 'lib/memoria.rb', line 20 def current_snapshot snapshots.last end |
#record(snapshot_name) ⇒ Snapshot
Records a new snapshot.
99 100 101 102 |
# File 'lib/memoria.rb', line 99 def record(snapshot_name) snapshot = Snapshot.new(snapshot_name) snapshots.push(snapshot) end |
#snapshot_saver ⇒ SnapshotSaver
Returns an entity to persist snapshots (on the file system).
84 85 86 |
# File 'lib/memoria.rb', line 84 def snapshot_saver @snapshot_saver ||= SnapshotSaver.new(configuration) end |
#snapshots ⇒ Array<Snapshot>
Returns the list of recorded snapshots.
70 71 72 |
# File 'lib/memoria.rb', line 70 def snapshots @snapshots ||= [] end |
#stop_recording ⇒ Array
Stops recording snapshots.
116 117 118 |
# File 'lib/memoria.rb', line 116 def stop_recording snapshots.clear end |