Class: Expire::BackupFromPathService

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

Overview

Take a path and return an instance of Expire::Backup

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path:) ⇒ BackupFromPathService

Returns a new instance of BackupFromPathService.



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

def initialize(path:)
  @pathname = Pathname.new(path)
end

Instance Attribute Details

#byObject (readonly)

Returns the value of attribute by.



14
15
16
# File 'lib/expire/backup_from_path_service.rb', line 14

def by
  @by
end

#pathnameObject (readonly)

Returns the value of attribute pathname.



14
15
16
# File 'lib/expire/backup_from_path_service.rb', line 14

def pathname
  @pathname
end

Class Method Details

.call(path:) ⇒ Object



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

def self.call(path:)
  new(path: path).call
end

Instance Method Details

#callObject



16
17
18
# File 'lib/expire/backup_from_path_service.rb', line 16

def call
  Backup.new(time: time, pathname: pathname)
end