Class: RRBA::User

Inherits:
Object
  • Object
show all
Defined in:
lib/rrba/user.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#emailObject

Returns the value of attribute email.



6
7
8
# File 'lib/rrba/user.rb', line 6

def email
  @email
end

#nameObject

Returns the value of attribute name.



6
7
8
# File 'lib/rrba/user.rb', line 6

def name
  @name
end

#public_keyObject

Returns the value of attribute public_key.



6
7
8
# File 'lib/rrba/user.rb', line 6

def public_key
  @public_key
end

#short_nameObject

Returns the value of attribute short_name.



6
7
8
# File 'lib/rrba/user.rb', line 6

def short_name
  @short_name
end

#unique_idObject (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_sessionObject

Raises:

  • (NotImplementedError)


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