Class: ActiveModel::Password
- Inherits:
-
Object
- Object
- ActiveModel::Password
- Includes:
- Model
- Defined in:
- lib/active_model/password.rb,
lib/active_model/password/version.rb
Constant Summary collapse
- VERSION =
"1.0.1"
Instance Attribute Summary collapse
-
#password ⇒ Object
Returns the value of attribute password.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
Instance Attribute Details
#password ⇒ Object
Returns the value of attribute password.
8 9 10 |
# File 'lib/active_model/password.rb', line 8 def password @password end |
#user ⇒ Object
Returns the value of attribute user.
8 9 10 |
# File 'lib/active_model/password.rb', line 8 def user @user end |
Instance Method Details
#persisted? ⇒ Boolean
18 19 20 |
# File 'lib/active_model/password.rb', line 18 def persisted? user? and user.persisted? end |
#save ⇒ Object
22 23 24 25 26 |
# File 'lib/active_model/password.rb', line 22 def save return false unless valid? user.password = password user.save end |
#user? ⇒ Boolean
14 15 16 |
# File 'lib/active_model/password.rb', line 14 def user? user.present? end |