Module: WithTimedEnablement

Extended by:
ActiveSupport::Concern
Included in:
Exam, ExamRegistration
Defined in:
app/models/concerns/with_timed_enablement.rb

Instance Method Summary collapse

Instance Method Details

#enabled?Boolean

Returns:

  • (Boolean)


4
5
6
# File 'app/models/concerns/with_timed_enablement.rb', line 4

def enabled?
  enabled_range.cover? Time.current
end

#enabled_rangeObject



8
9
10
# File 'app/models/concerns/with_timed_enablement.rb', line 8

def enabled_range
  start_time..end_time
end