Sha256: 11b6ea95bbcb480cf40a7b6f3412970168cba958a5e86345437862f52f928afb

Contents?: true

Size: 299 Bytes

Versions: 5

Compression:

Stored size: 299 Bytes

Contents

module Koine
  module DbBkp
    class FileName
      def initialize(pattern)
        @pattern = pattern
      end

      def to_s
        @pattern.gsub('{timestamp}', timestamp)
      end

      private

      def timestamp
        Time.now.strftime('%Y-%m-%d_%H-%M-%S')
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
koine-db_bkp-0.1.4 lib/koine/db_bkp/file_name.rb
koine-db_bkp-0.1.3 lib/koine/db_bkp/file_name.rb
koine-db_bkp-0.1.2 lib/koine/db_bkp/file_name.rb
koine-db_bkp-0.1.1 lib/koine/db_bkp/file_name.rb
koine-db_bkp-0.1.0 lib/koine/db_bkp/file_name.rb