Skip to content
Snippets Groups Projects
Verified Commit 1872859d authored by Rémy Coutable's avatar Rémy Coutable
Browse files

Don't declare constants in Struct


Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent a69aa3da
No related branches found
No related tags found
1 merge request!9582Don't declare constants in Struct
Pipeline #
AccessTokenValidationService = Struct.new(:token) do class AccessTokenValidationService
# Results: # Results:
VALID = :valid VALID = :valid
EXPIRED = :expired EXPIRED = :expired
REVOKED = :revoked REVOKED = :revoked
INSUFFICIENT_SCOPE = :insufficient_scope INSUFFICIENT_SCOPE = :insufficient_scope
   
attr_reader :token
def initialize(token)
@token = token
end
def validate(scopes: []) def validate(scopes: [])
if token.expired? if token.expired?
return EXPIRED return EXPIRED
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment