Class: Authkeeper::Configuration
- Inherits:
-
Object
- Object
- Authkeeper::Configuration
- Defined in:
- lib/authkeeper/configuration.rb
Constant Summary collapse
- InitializeError =
Class.new(StandardError)
Instance Attribute Summary collapse
-
#access_token_name ⇒ Object
Returns the value of attribute access_token_name.
-
#domain ⇒ Object
Returns the value of attribute domain.
-
#fallback_url_session_name ⇒ Object
Returns the value of attribute fallback_url_session_name.
-
#omniauth_configs ⇒ Object
readonly
Returns the value of attribute omniauth_configs.
-
#omniauth_providers ⇒ Object
Returns the value of attribute omniauth_providers.
-
#user_model ⇒ Object
Returns the value of attribute user_model.
-
#user_session_model ⇒ Object
Returns the value of attribute user_session_model.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #omniauth(provider, **args) ⇒ Object
- #validate ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/authkeeper/configuration.rb', line 10 def initialize @user_model = 'User' @user_session_model = 'User::Session' @access_token_name = nil @domain = nil @fallback_url_session_name = nil @omniauth_providers = [] @omniauth_configs = {} end |
Instance Attribute Details
#access_token_name ⇒ Object
Returns the value of attribute access_token_name.
7 8 9 |
# File 'lib/authkeeper/configuration.rb', line 7 def access_token_name @access_token_name end |
#domain ⇒ Object
Returns the value of attribute domain.
7 8 9 |
# File 'lib/authkeeper/configuration.rb', line 7 def domain @domain end |
#fallback_url_session_name ⇒ Object
Returns the value of attribute fallback_url_session_name.
7 8 9 |
# File 'lib/authkeeper/configuration.rb', line 7 def fallback_url_session_name @fallback_url_session_name end |
#omniauth_configs ⇒ Object (readonly)
Returns the value of attribute omniauth_configs.
8 9 10 |
# File 'lib/authkeeper/configuration.rb', line 8 def omniauth_configs @omniauth_configs end |
#omniauth_providers ⇒ Object
Returns the value of attribute omniauth_providers.
7 8 9 |
# File 'lib/authkeeper/configuration.rb', line 7 def omniauth_providers @omniauth_providers end |
#user_model ⇒ Object
Returns the value of attribute user_model.
7 8 9 |
# File 'lib/authkeeper/configuration.rb', line 7 def user_model @user_model end |
#user_session_model ⇒ Object
Returns the value of attribute user_session_model.
7 8 9 |
# File 'lib/authkeeper/configuration.rb', line 7 def user_session_model @user_session_model end |
Instance Method Details
#omniauth(provider, **args) ⇒ Object
28 29 30 |
# File 'lib/authkeeper/configuration.rb', line 28 def omniauth(provider, **args) @omniauth_configs[provider] = args end |
#validate ⇒ Object
22 23 24 25 26 |
# File 'lib/authkeeper/configuration.rb', line 22 def validate raise InitializeError, 'User model must be present' if user_model.nil? raise InitializeError, 'User session model must be present' if user_session_model.nil? raise InitializeError, 'Access token name must be present' if access_token_name.nil? end |