Sha256: b9b0fadf7184dfc50c107259fa40dcc5abdb2cebca9f27e83ca1f7e382032aef
Contents?: true
Size: 753 Bytes
Versions: 2
Compression:
Stored size: 753 Bytes
Contents
# frozen_string_literal: true require 'pg_export/value_objects/result' class PgExport module Operations class RemoveOldDumps def initialize(gateway_dump_repository:, keep:) @gateway_dump_repository, @keep = gateway_dump_repository, keep end def name :remove_old_dumps end def call(dump:, gateway:) dumps = gateway_dump_repository.by_database_name( database_name: dump.database, gateway: gateway, offset: keep ) dumps.each do |d| gateway.delete(d.name) end ValueObjects::Success.new(removed_dumps: dumps, gateway: gateway) end private attr_reader :gateway_dump_repository, :keep end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
pg_export-1.0.0 | lib/pg_export/operations/remove_old_dumps.rb |
pg_export-1.0.0.rc8 | lib/pg_export/operations/remove_old_dumps.rb |