Class: RRBA::User
- Inherits:
-
Object
- Object
- RRBA::User
- Defined in:
- lib/rrba/user.rb
Instance Attribute Summary collapse
-
#email ⇒ Object
Returns the value of attribute email.
-
#name ⇒ Object
Returns the value of attribute name.
-
#public_key ⇒ Object
Returns the value of attribute public_key.
-
#short_name ⇒ Object
Returns the value of attribute short_name.
-
#unique_id ⇒ Object
readonly
Returns the value of attribute unique_id.
Instance Method Summary collapse
- #authenticate(challenge, signature) ⇒ Object
-
#initialize(unique_id) ⇒ User
constructor
A new instance of User.
- #new_session ⇒ Object
Constructor Details
#initialize(unique_id) ⇒ User
Returns a new instance of User.
7 8 9 |
# File 'lib/rrba/user.rb', line 7 def initialize(unique_id) @unique_id = unique_id or raise "Invalid ID #{unique_id}" end |
Instance Attribute Details
#email ⇒ Object
Returns the value of attribute email.
6 7 8 |
# File 'lib/rrba/user.rb', line 6 def email @email end |
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/rrba/user.rb', line 6 def name @name end |
#public_key ⇒ Object
Returns the value of attribute public_key.
6 7 8 |
# File 'lib/rrba/user.rb', line 6 def public_key @public_key end |
#short_name ⇒ Object
Returns the value of attribute short_name.
6 7 8 |
# File 'lib/rrba/user.rb', line 6 def short_name @short_name end |
#unique_id ⇒ Object (readonly)
Returns the value of attribute unique_id.
6 7 8 |
# File 'lib/rrba/user.rb', line 6 def unique_id @unique_id end |
Instance Method Details
#authenticate(challenge, signature) ⇒ Object
10 11 12 13 14 |
# File 'lib/rrba/user.rb', line 10 def authenticate(challenge, signature) # enable lazy initializing # (for subclasses that can be persisted) public_key.sysverify(challenge, signature) end |
#new_session ⇒ Object
25 26 27 28 |
# File 'lib/rrba/user.rb', line 25 def new_session raise NotImplementedError, "no predefined behavior for RRBA::User#new_session" end |