Class: Expire::PurgeService

Inherits:
Object
  • Object
show all
Defined in:
lib/expire/purge_service.rb

Overview

Purge expired backups

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, options) ⇒ PurgeService



10
11
12
13
# File 'lib/expire/purge_service.rb', line 10

def initialize(path, options)
  @options = options
  @path = path
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



15
16
17
# File 'lib/expire/purge_service.rb', line 15

def options
  @options
end

#pathObject (readonly)

Returns the value of attribute path.



15
16
17
# File 'lib/expire/purge_service.rb', line 15

def path
  @path
end

Class Method Details

.call(path, options) ⇒ Object



6
7
8
# File 'lib/expire/purge_service.rb', line 6

def self.call(path, options)
  new(path, options).call
end

Instance Method Details

#callObject



17
18
19
20
21
22
23
# File 'lib/expire/purge_service.rb', line 17

def call
  check_preconditions
  purge_expired_backups
rescue => e
  report.error(e.message)
  raise
end