Class: Rhales::Adapters::BaseAuth
- Inherits:
-
Object
- Object
- Rhales::Adapters::BaseAuth
- Defined in:
- lib/rhales/adapters/base_auth.rb
Overview
Base authentication adapter interface
Defines the contract that authentication adapters must implement to work with Rhales. This allows the library to work with any authentication system by implementing this interface.
Direct Known Subclasses
Class Method Summary collapse
-
.anonymous ⇒ Object
Create anonymous user instance.
Instance Method Summary collapse
-
#anonymous? ⇒ Boolean
Check if user is anonymous.
-
#attributes ⇒ Object
Get user attributes as hash (optional).
-
#display_name ⇒ Object
Get user display name (optional).
-
#role? ⇒ Boolean
Check if user has specific role/permission (optional).
-
#theme_preference ⇒ Object
Get user’s theme preference.
-
#user_id ⇒ Object
Get user identifier (optional).
Class Method Details
.anonymous ⇒ Object
Create anonymous user instance
45 46 47 |
# File 'lib/rhales/adapters/base_auth.rb', line 45 def anonymous new end |
Instance Method Details
#anonymous? ⇒ Boolean
Check if user is anonymous
14 15 16 |
# File 'lib/rhales/adapters/base_auth.rb', line 14 def anonymous? raise NotImplementedError, 'Subclasses must implement #anonymous?' end |
#attributes ⇒ Object
Get user attributes as hash (optional)
39 40 41 |
# File 'lib/rhales/adapters/base_auth.rb', line 39 def attributes {} end |
#display_name ⇒ Object
Get user display name (optional)
29 30 31 |
# File 'lib/rhales/adapters/base_auth.rb', line 29 def display_name nil end |
#role? ⇒ Boolean
Check if user has specific role/permission (optional)
34 35 36 |
# File 'lib/rhales/adapters/base_auth.rb', line 34 def role?(*) raise NotImplementedError, 'Subclasses must implement #role?' end |
#theme_preference ⇒ Object
Get user’s theme preference
19 20 21 |
# File 'lib/rhales/adapters/base_auth.rb', line 19 def theme_preference raise NotImplementedError, 'Subclasses must implement #theme_preference' end |
#user_id ⇒ Object
Get user identifier (optional)
24 25 26 |
# File 'lib/rhales/adapters/base_auth.rb', line 24 def user_id nil end |