Class: Booth::Requests::Storages::Webauth

Inherits:
Object
  • Object
show all
Includes:
Logging
Defined in:
lib/booth/requests/storages/webauth.rb

Instance Method Summary collapse

Constructor Details

#initialize(session:) ⇒ Webauth

Returns a new instance of Webauth.



9
10
11
# File 'lib/booth/requests/storages/webauth.rb', line 9

def initialize(session:)
  @session = session
end

Instance Method Details

#authenticatorObject


Getters




17
18
19
20
21
22
# File 'lib/booth/requests/storages/webauth.rb', line 17

def authenticator
  return @authenticator if defined?(@authenticator)
  return if session[:authenticator_id].blank?

  @authenticator = ::Booth::Models::Authenticator.find_by(id: session[:authenticator_id])
end

#authenticator_id=(new_authenticator_id) ⇒ Object


Setters




28
29
30
# File 'lib/booth/requests/storages/webauth.rb', line 28

def authenticator_id=(new_authenticator_id)
  session[:authenticator_id] = new_authenticator_id
end