Class: SignIn::CredentialLevel

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Validations
Defined in:
app/models/sign_in/credential_level.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(requested_acr:, credential_type:, current_ial:, max_ial:, auto_uplevel: false) ⇒ CredentialLevel

Returns a new instance of CredentialLevel.



21
22
23
24
25
26
27
28
29
# File 'app/models/sign_in/credential_level.rb', line 21

def initialize(requested_acr:, credential_type:, current_ial:, max_ial:, auto_uplevel: false)
  @requested_acr = requested_acr
  @credential_type = credential_type
  @current_ial = current_ial
  @max_ial = max_ial
  @auto_uplevel = auto_uplevel

  validate!
end

Instance Attribute Details

#auto_uplevelObject (readonly)

Returns the value of attribute auto_uplevel.



7
8
9
# File 'app/models/sign_in/credential_level.rb', line 7

def auto_uplevel
  @auto_uplevel
end

#credential_typeObject (readonly)

Returns the value of attribute credential_type.



7
8
9
# File 'app/models/sign_in/credential_level.rb', line 7

def credential_type
  @credential_type
end

#current_ialObject (readonly)

Returns the value of attribute current_ial.



7
8
9
# File 'app/models/sign_in/credential_level.rb', line 7

def current_ial
  @current_ial
end

#max_ialObject (readonly)

Returns the value of attribute max_ial.



7
8
9
# File 'app/models/sign_in/credential_level.rb', line 7

def max_ial
  @max_ial
end

#requested_acrObject (readonly)

Returns the value of attribute requested_acr.



7
8
9
# File 'app/models/sign_in/credential_level.rb', line 7

def requested_acr
  @requested_acr
end

Instance Method Details

#can_uplevel_credential?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'app/models/sign_in/credential_level.rb', line 31

def can_uplevel_credential?
  requested_acr == Constants::Auth::MIN && current_ial < max_ial
end