Class: Adamantite::GUI::Request::AddPasswordRequest
- Inherits:
-
Object
- Object
- Adamantite::GUI::Request::AddPasswordRequest
- Defined in:
- lib/gui/request/add_password_request.rb
Instance Attribute Summary collapse
-
#password ⇒ Object
Returns the value of attribute password.
-
#password_confirmation ⇒ Object
Returns the value of attribute password_confirmation.
-
#password_saved ⇒ Object
Returns the value of attribute password_saved.
-
#username ⇒ Object
Returns the value of attribute username.
-
#website_title ⇒ Object
Returns the value of attribute website_title.
Instance Method Summary collapse
- #confirm_and_add_password! ⇒ Object
-
#initialize(master_password, master_password_salt) ⇒ AddPasswordRequest
constructor
A new instance of AddPasswordRequest.
Constructor Details
#initialize(master_password, master_password_salt) ⇒ AddPasswordRequest
Returns a new instance of AddPasswordRequest.
9 10 11 12 13 |
# File 'lib/gui/request/add_password_request.rb', line 9 def initialize(master_password, master_password_salt) @master_password = master_password @master_password_salt = master_password_salt @password_saved = false end |
Instance Attribute Details
#password ⇒ Object
Returns the value of attribute password.
7 8 9 |
# File 'lib/gui/request/add_password_request.rb', line 7 def password @password end |
#password_confirmation ⇒ Object
Returns the value of attribute password_confirmation.
7 8 9 |
# File 'lib/gui/request/add_password_request.rb', line 7 def password_confirmation @password_confirmation end |
#password_saved ⇒ Object
Returns the value of attribute password_saved.
7 8 9 |
# File 'lib/gui/request/add_password_request.rb', line 7 def password_saved @password_saved end |
#username ⇒ Object
Returns the value of attribute username.
7 8 9 |
# File 'lib/gui/request/add_password_request.rb', line 7 def username @username end |
#website_title ⇒ Object
Returns the value of attribute website_title.
7 8 9 |
# File 'lib/gui/request/add_password_request.rb', line 7 def website_title @website_title end |
Instance Method Details
#confirm_and_add_password! ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/gui/request/add_password_request.rb', line 15 def confirm_and_add_password! return unless @password == @password_confirmation @password_saved = true pw_info_for_file = make_pw_info(@username, @password, @master_password, @master_password_salt) write_pw_to_file(@website_title, **pw_info_for_file) end |