lib/expire/backup.rb in expire-0.2.2 vs lib/expire/backup.rb in expire-0.2.3

- old
+ new

@@ -4,20 +4,20 @@ # Representation of a single backup class Backup < Delegator include Comparable def initialize(time:, pathname:) - @time = time + @time = time @pathname = pathname # @reasons_to_keep is a Set so a reason can added multiple times # but appears only once @reasons_to_keep = Set.new end attr_reader :time, :pathname, :reasons_to_keep - alias __getobj__ time + alias_method :__getobj__, :time def same_hour?(other) return false unless same_day?(other) return true if hour == other.hour @@ -62,11 +62,11 @@ # def time # backup.time # end def cweek - time&.strftime('%V').to_i + time&.strftime("%V").to_i end def expired? reasons_to_keep.empty? end @@ -74,9 +74,9 @@ def keep? reasons_to_keep.any? end def to_s - time.strftime('%Y-%m-%dT%H:%M') + time.strftime("%Y-%m-%dT%H:%M") end end end