Class: Masks::Actors::Anonymous
- Inherits:
-
Masks::ApplicationModel
- Object
- Masks::ApplicationModel
- Masks::Actors::Anonymous
- Includes:
- Masks::Actor
- Defined in:
- app/models/masks/actors/anonymous.rb
Overview
An anonymous actor, used for cases where deemed acceptable.
Instance Method Summary collapse
-
#anonymous? ⇒ Boolean
Mark this actor as anonymous.
-
#mask! ⇒ Boolean
This is a no-op for anonymous actors.
-
#nickname ⇒ String
Generates and returns random nickname for the actor.
-
#scopes ⇒ Array
An empty array, since no scopes are available to anonymous actors.
Methods included from Masks::Actor
#actor_id, #authenticate, #backup?, #factor2?, #password=, #session=, #session_key, #version
Methods included from Scoped
#role?, #role_records, #roles, #scope?
Instance Method Details
#anonymous? ⇒ Boolean
Mark this actor as anonymous.
35 36 37 |
# File 'app/models/masks/actors/anonymous.rb', line 35 def anonymous? true end |
#mask! ⇒ Boolean
This is a no-op for anonymous actors. It always returns true.
28 29 30 |
# File 'app/models/masks/actors/anonymous.rb', line 28 def mask! true end |
#nickname ⇒ String
Generates and returns random nickname for the actor.
16 17 18 |
# File 'app/models/masks/actors/anonymous.rb', line 16 def nickname @nickname ||= "anon:#{SecureRandom.hex}" end |
#scopes ⇒ Array
Returns an empty array, since no scopes are available to anonymous actors.
21 22 23 |
# File 'app/models/masks/actors/anonymous.rb', line 21 def scopes [] end |