Class: DatedBackup::ExecutionContext

Inherits:
Object
  • Object
show all
Defined in:
lib/dated_backup/dsl/execution_context.rb

Defined Under Namespace

Classes: Around, Main

Instance Method Summary collapse

Constructor Details

#initialize(name, *params, &blk) ⇒ ExecutionContext

Returns a new instance of ExecutionContext.



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/dated_backup/dsl/execution_context.rb', line 5

def initialize(name, *params, &blk)  
  DatedBackup::Warnings.execute_silently do
    if name == :main
      params.each do |filename|
        Main.load filename
      end
    elsif name == :before || name == :after
      Around.new &blk
    end        
  end
end