Class: Bard::Backup::Deleter::Filter

Inherits:
Struct
  • Object
show all
Defined in:
lib/bard/backup/deleter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#limitObject

Returns the value of attribute limit

Returns:

  • (Object)

    the current value of limit



24
25
26
# File 'lib/bard/backup/deleter.rb', line 24

def limit
  @limit
end

#nowObject

Returns the value of attribute now

Returns:

  • (Object)

    the current value of now



24
25
26
# File 'lib/bard/backup/deleter.rb', line 24

def now
  @now
end

#unitObject

Returns the value of attribute unit

Returns:

  • (Object)

    the current value of unit



24
25
26
# File 'lib/bard/backup/deleter.rb', line 24

def unit
  @unit
end

Instance Method Details

#cover?(file) ⇒ Boolean

Returns:

  • (Boolean)


25
26
27
28
29
30
# File 'lib/bard/backup/deleter.rb', line 25

def cover? file
  remote = DateTime.parse(file).beginning_of_hour
  limit.times.any? do |count|
    remote == ago(count)
  end
end