gitlab-org--gitlab-foss/lib/api/support/token_with_expiration.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
421 B
Ruby
Raw Normal View History

# frozen_string_literal: true
module API
module Support
class TokenWithExpiration
def initialize(strategy, instance)
@strategy = strategy
@instance = instance
end
def token
@strategy.get_token(@instance)
end
def token_expires_at
@strategy.expires_at(@instance)
end
def expirable?
@strategy.expirable?
end
end
end
end