Class: ReversibleData::TableManager
- Inherits:
-
Object
- Object
- ReversibleData::TableManager
- Defined in:
- lib/reversible_data/table_manager.rb
Instance Attribute Summary collapse
-
#managed_tables ⇒ Object
readonly
Returns the value of attribute managed_tables.
Instance Method Summary collapse
- #down! ⇒ Object
-
#initialize(*managed_tables) ⇒ TableManager
constructor
A new instance of TableManager.
- #up! ⇒ Object
Constructor Details
#initialize(*managed_tables) ⇒ TableManager
Returns a new instance of TableManager.
6 7 8 |
# File 'lib/reversible_data/table_manager.rb', line 6 def initialize(*managed_tables) @managed_tables = managed_tables.map { |n| n.to_sym }.freeze end |
Instance Attribute Details
#managed_tables ⇒ Object (readonly)
Returns the value of attribute managed_tables.
4 5 6 |
# File 'lib/reversible_data/table_manager.rb', line 4 def managed_tables @managed_tables end |
Instance Method Details
#down! ⇒ Object
17 18 19 20 21 22 |
# File 'lib/reversible_data/table_manager.rb', line 17 def down! @managed_tables.each do |name| table = table_for(name) table.down! unless table.nil? end end |
#up! ⇒ Object
10 11 12 13 14 15 |
# File 'lib/reversible_data/table_manager.rb', line 10 def up! @managed_tables.each do |name| table = table_for(name) table.up! unless table.nil? end end |