Class: User
- Inherits:
-
Object
- Object
- User
- Includes:
- ArAdapter, DmAdapter, MmAdapter, MongoidAdapter, SequelAdapter, TcAdapter
- Defined in:
- lib/models/abstract_user.rb
Class Method Summary collapse
Instance Method Summary collapse
- #db_instance ⇒ Object
- #id ⇒ Object
-
#initialize(interfacing_class_instance) ⇒ User
constructor
A new instance of User.
Methods included from ArAdapter
Methods included from MongoidAdapter
Methods included from SequelAdapter
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.
39 40 41 |
# File 'lib/models/abstract_user.rb', line 39 def initialize(interfacing_class_instance) @instance = interfacing_class_instance end |
Class Method Details
.authenticate(name, pass) ⇒ Object
47 48 49 50 51 52 |
# File 'lib/models/abstract_user.rb', line 47 def self.authenticate(name, pass) current_user = get(:name => name) 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
#db_instance ⇒ Object
54 55 56 |
# File 'lib/models/abstract_user.rb', line 54 def db_instance @instance end |
#id ⇒ Object
43 44 45 |
# File 'lib/models/abstract_user.rb', line 43 def id @instance.id end |