Class: Mongration::Migrate::Direction

Inherits:
Object
  • Object
show all
Defined in:
lib/mongration/migrate/direction.rb

Direct Known Subclasses

Down, Up

Instance Method Summary collapse

Constructor Details

#initialize(files) ⇒ Direction

Returns a new instance of Direction.



5
6
7
# File 'lib/mongration/migrate/direction.rb', line 5

def initialize(files)
  @files = files
end

Instance Method Details

#performObject



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/mongration/migrate/direction.rb', line 9

def perform
  @files.each do |file|
    file.load

    summarize(description_for(file)) do
      migrate(file)
    end

    persist(file)
  end
end