Class: Mv::Core::Migration::Operations::List
- Inherits:
-
Object
- Object
- Mv::Core::Migration::Operations::List
- Defined in:
- lib/mv/core/migration/operations/list.rb
Instance Attribute Summary collapse
-
#operations ⇒ Object
readonly
Returns the value of attribute operations.
Instance Method Summary collapse
- #add_operation(operation) ⇒ Object
- #execute ⇒ Object
-
#initialize ⇒ List
constructor
A new instance of List.
- #tables ⇒ Object
Constructor Details
#initialize ⇒ List
Returns a new instance of List.
8 9 10 |
# File 'lib/mv/core/migration/operations/list.rb', line 8 def initialize() @operations = [] end |
Instance Attribute Details
#operations ⇒ Object (readonly)
Returns the value of attribute operations.
6 7 8 |
# File 'lib/mv/core/migration/operations/list.rb', line 6 def operations @operations end |
Instance Method Details
#add_operation(operation) ⇒ Object
12 13 14 |
# File 'lib/mv/core/migration/operations/list.rb', line 12 def add_operation(operation) operations << operation end |
#execute ⇒ Object
16 17 18 19 |
# File 'lib/mv/core/migration/operations/list.rb', line 16 def execute operations.each(&:execute) operations.clear end |
#tables ⇒ Object
21 22 23 |
# File 'lib/mv/core/migration/operations/list.rb', line 21 def tables operations.collect(&:table_name) end |