Class: AfterMigrate::Stores::Memory
- Inherits:
-
Object
- Object
- AfterMigrate::Stores::Memory
- Defined in:
- lib/after_migrate/store.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#affected_tables ⇒ Object
readonly
Returns the value of attribute affected_tables.
Instance Method Summary collapse
-
#initialize ⇒ Memory
constructor
A new instance of Memory.
- #merge_tables(schema, table_names) ⇒ Object
- #reset! ⇒ Object
Constructor Details
#initialize ⇒ Memory
Returns a new instance of Memory.
11 12 13 |
# File 'lib/after_migrate/store.rb', line 11 def initialize @affected_tables = Concurrent::Map.new end |
Instance Attribute Details
#affected_tables ⇒ Object (readonly)
Returns the value of attribute affected_tables.
9 10 11 |
# File 'lib/after_migrate/store.rb', line 9 def affected_tables @affected_tables end |
Instance Method Details
#merge_tables(schema, table_names) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/after_migrate/store.rb', line 15 def merge_tables(schema, table_names) return if table_names.blank? set = affected_tables.compute_if_absent(schema) { Concurrent::Set.new } set.merge(table_names) end |
#reset! ⇒ Object
22 23 24 |
# File 'lib/after_migrate/store.rb', line 22 def reset! @affected_tables = Concurrent::Map.new end |