Module: Shield::Model::ClassMethods
- Defined in:
- lib/shield.rb
Instance Method Summary collapse
- #authenticate(username, password) ⇒ Object
- #fetch(login) ⇒ Object
- #is_valid_password?(user, password) ⇒ Boolean
Instance Method Details
#authenticate(username, password) ⇒ Object
78 79 80 81 82 83 84 |
# File 'lib/shield.rb', line 78 def authenticate(username, password) user = fetch(username) if user and is_valid_password?(user, password) return user end end |
#fetch(login) ⇒ Object
86 87 88 |
# File 'lib/shield.rb', line 86 def fetch(login) raise FetchMissing, "#{self}.fetch not implemented" end |