demarches-normaliennes/app/lib/api_entreprise/privileges_adapter.rb
2024-08-22 09:26:48 +02:00

24 lines
334 B
Ruby

# frozen_string_literal: true
class APIEntreprise::PrivilegesAdapter < APIEntreprise::Adapter
def initialize(token)
@token = token
end
def valid?
begin
get_resource
true
rescue
false
end
end
private
def get_resource
api.tap do
_1.token = @token
end.privileges
end
end