Module: RunnerTokenExpirationInterval

Extended by:
ActiveSupport::Concern
Included in:
Group, Project
Defined in:
app/models/concerns/runner_token_expiration_interval.rb

Instance Method Summary collapse

Instance Method Details

#effective_runner_token_expiration_intervalObject


11
12
13
14
15
16
# File 'app/models/concerns/runner_token_expiration_interval.rb', line 11

def effective_runner_token_expiration_interval
  [
    enforced_runner_token_expiration_interval,
    runner_token_expiration_interval&.seconds
  ].compact.min
end

#effective_runner_token_expiration_interval_human_readableObject


18
19
20
21
# File 'app/models/concerns/runner_token_expiration_interval.rb', line 18

def effective_runner_token_expiration_interval_human_readable
  interval = effective_runner_token_expiration_interval
  ChronicDuration.output(interval, format: :short) if interval
end

#enforced_runner_token_expiration_interval_human_readableObject


6
7
8
9
# File 'app/models/concerns/runner_token_expiration_interval.rb', line 6

def enforced_runner_token_expiration_interval_human_readable
  interval = enforced_runner_token_expiration_interval
  ChronicDuration.output(interval, format: :short) if interval
end