Module: Shield::Model
- Defined in:
- lib/shield/model.rb
Defined Under Namespace
Classes: FetchMissing
Instance Method Summary collapse
- #authenticate(username, password) ⇒ Object
- #fetch(login) ⇒ Object
- #is_valid_password?(user, password) ⇒ Boolean
Instance Method Details
#authenticate(username, password) ⇒ Object
3 4 5 6 7 8 9 |
# File 'lib/shield/model.rb', line 3 def authenticate(username, password) user = fetch(username) if user and is_valid_password?(user, password) return user end end |
#fetch(login) ⇒ Object
11 12 13 |
# File 'lib/shield/model.rb', line 11 def fetch(login) raise FetchMissing end |