Class: User

Inherits:
CouchRest::Model::Base
  • Object
show all
Includes:
SRP::Authentication
Defined in:
app/models/user.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.find_by_param(login) ⇒ Object



20
21
22
# File 'app/models/user.rb', line 20

def find_by_param()
  return () || raise(RECORD_NOT_FOUND)
end

.valid_attributes_hashObject

valid set of attributes for testing



25
26
27
28
29
# File 'app/models/user.rb', line 25

def valid_attributes_hash
  { :login => "me",
    :password_verifier => "1234",
    :password_salt => "4321" }
end

Instance Method Details

#saltObject



41
42
43
# File 'app/models/user.rb', line 41

def salt
  password_salt.hex
end

#to_json(options = {}) ⇒ Object



37
38
39
# File 'app/models/user.rb', line 37

def to_json(options={})
  super(options.merge(:only => ['login', 'password_salt']))
end

#to_paramObject



33
34
35
# File 'app/models/user.rb', line 33

def to_param
  self.
end

#verifierObject



45
46
47
# File 'app/models/user.rb', line 45

def verifier
  password_verifier.hex
end