debian-mirror-gitlab/lib/api/support/token_with_expiration.rb
2022-04-04 11:22:00 +05:30

24 lines
421 B
Ruby

# 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