Class: Mv::Core::Migration::Operations::List

Inherits:
Object
  • Object
show all
Defined in:
lib/mv/core/migration/operations/list.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeList

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

#operationsObject (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

#executeObject



16
17
18
19
# File 'lib/mv/core/migration/operations/list.rb', line 16

def execute
  operations.each(&:execute)
  operations.clear
end

#tablesObject



21
22
23
# File 'lib/mv/core/migration/operations/list.rb', line 21

def tables
  operations.collect(&:table_name)
end