Sha256: 9627ec5c8c7f2f9a4879fc43460bee9f182d649a77eee7777867913434924710
Contents?: true
Size: 648 Bytes
Versions: 11
Compression:
Stored size: 648 Bytes
Contents
# frozen_string_literal: true module Backup module S3Helper def get_delete_items(items, keep) items.slice(keep..-1) end def get_months(all_items) all_items.reverse.map { |m| m[:last_modified].strftime('%Y-%m') } end def get_old_months(months) months.uniq.reject { |m| m == Time.now.strftime('%Y-%m') } end def get_current_month(all_items) all_items.select { |item| item[:last_modified].strftime('%Y-%m') == Time.now.strftime('%Y-%m') } end def get_items_by_month(all_items, month) all_items.select { |item| item[:last_modified].strftime('%Y-%m') == month } end end end
Version data entries
11 entries across 11 versions & 1 rubygems