Class: CouchbaseOrm::IndexMigration::CommandRecorder
- Inherits:
-
Object
- Object
- CouchbaseOrm::IndexMigration::CommandRecorder
- Defined in:
- lib/couchbase-orm/index_migration/command_recorder.rb
Instance Method Summary collapse
-
#initialize ⇒ CommandRecorder
constructor
A new instance of CommandRecorder.
- #record(operation) ⇒ Object
- #replay_inverse(migration) ⇒ Object
Constructor Details
#initialize ⇒ CommandRecorder
Returns a new instance of CommandRecorder.
6 7 8 |
# File 'lib/couchbase-orm/index_migration/command_recorder.rb', line 6 def initialize @operations = [] end |
Instance Method Details
#record(operation) ⇒ Object
10 11 12 |
# File 'lib/couchbase-orm/index_migration/command_recorder.rb', line 10 def record(operation) @operations << operation end |
#replay_inverse(migration) ⇒ Object
14 15 16 17 18 |
# File 'lib/couchbase-orm/index_migration/command_recorder.rb', line 14 def replay_inverse(migration) @operations.reverse_each do |operation| operation.inverse.execute(migration) end end |