Class: User
- Inherits:
-
Object
- Object
- User
- Defined in:
- lib/models/abstract_user.rb
Class Method Summary collapse
Instance Method Summary collapse
- #id ⇒ Object
-
#initialize(interfacing_class_instance) ⇒ User
constructor
A new instance of User.
Methods included from MmAdapter
Methods included from TcAdapter
Methods included from DmAdapter
Constructor Details
#initialize(interfacing_class_instance) ⇒ User
Returns a new instance of User.
26 27 28 |
# File 'lib/models/abstract_user.rb', line 26 def initialize(interfacing_class_instance) @instance = interfacing_class_instance end |
Class Method Details
.authenticate(email, pass) ⇒ Object
34 35 36 37 38 39 |
# File 'lib/models/abstract_user.rb', line 34 def self.authenticate(email, pass) current_user = get(:email => email) return nil if current_user.nil? return current_user if User.encrypt(pass, current_user.salt) == current_user.hashed_password nil end |
Instance Method Details
#id ⇒ Object
30 31 32 |
# File 'lib/models/abstract_user.rb', line 30 def id @instance.id end |