Class: DatedBackup::ExecutionContext::Around

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

Instance Method Summary collapse

Methods included from ExecutionContextHelper

#anonymous_instance_loading_module

Constructor Details

#initialize(around = self, &blk) ⇒ Around

Returns a new instance of Around.



52
53
54
# File 'lib/dated_backup/dsl/execution_context.rb', line 52

def initialize(around=self, &blk)
  around.instance_eval &blk
end

Instance Method Details

#remove_old(&blk) ⇒ Object



56
57
58
59
60
# File 'lib/dated_backup/dsl/execution_context.rb', line 56

def remove_old(&blk)
  instance = anonymous_instance_loading_module(DSL::TimeExtensions)
  instance.instance_eval &blk
  Core::BackupRemover.remove!(Main.instance.backup_root, instance.kept)
end