Class: Pixiurge::Authentication::AccountStorage
- Inherits:
-
Object
- Object
- Pixiurge::Authentication::AccountStorage
- Defined in:
- lib/pixiurge/authentication.rb
Overview
This stores a collection of Pixiurge accounts. If you want to store accounts in a nonstandard way, this is the interface to match - inheritance could be a useful way to do it, but duck-typing is fine too. You can pass a AccountStorage into the constructor for a Pixiurge::AuthenticatedApp.
Direct Known Subclasses
Instance Method Summary collapse
-
#data_for(username) ⇒ Hash{String=>String}
Get user data for the named account.
-
#register(username, account_data) ⇒ void
Create an account.
-
#set_data_for(username, new_data) ⇒ void
Set user data for the named account.
-
#unregister(username) ⇒ void
Unregister the named account; delete it from the AccountStorage.
Instance Method Details
#data_for(username) ⇒ Hash{String=>String}
Get user data for the named account.
274 275 276 |
# File 'lib/pixiurge/authentication.rb', line 274 def data_for(username) raise "Override data_for to create a valid AccountStorage object!" end |
#register(username, account_data) ⇒ void
This method returns an undefined value.
Create an account. The account_data hash will contain information about the encrypted password hash in the default setup, but it's allowed to contain any JSON-serializable Hash in general.
265 266 267 |
# File 'lib/pixiurge/authentication.rb', line 265 def register(username, account_data) raise "Override register to create a valid AccountStorage object!" end |
#set_data_for(username, new_data) ⇒ void
This method returns an undefined value.
Set user data for the named account. Any fields not included in the new value are deleted.
285 286 287 |
# File 'lib/pixiurge/authentication.rb', line 285 def set_data_for(username, new_data) raise "Override set_data_for to create a valid AccountStorage object!" end |
#unregister(username) ⇒ void
This method returns an undefined value.
Unregister the named account; delete it from the AccountStorage.
294 295 296 |
# File 'lib/pixiurge/authentication.rb', line 294 def unregister(username) raise "Override unregister to create a valid AccountStorage object!" end |