Module: Preservation::Temporal

Defined in:
lib/preservation/temporal.rb

Overview

Temporal

Class Method Summary collapse

Class Method Details

.time_to_preserve?(start_utc, delay) ⇒ Boolean

time_to_preserve?

Parameters:

  • start_utc (Time)
  • delay (Integer)

    days to wait (after start date) before preserving

Returns:

  • (Boolean)


12
13
14
15
16
# File 'lib/preservation/temporal.rb', line 12

def self.time_to_preserve?(start_utc, delay)
  now = Time.now
  days_since_start = (now - start_utc).to_i # result in days
  days_since_start >= delay ? true : false
end