Module: Watobo::Gui::MasterPW
- Defined in:
- lib/watobo/gui/utils/master_password.rb
Class Method Summary collapse
- .disable ⇒ Object
- .enable ⇒ Object
-
.enabled? ⇒ Boolean
check if master password is set.
-
.get ⇒ Object
retrieve the master password.
- .save_passwords=(state) ⇒ Object
- .save_passwords? ⇒ Boolean
- .save_without_master=(state) ⇒ Object
- .save_without_master? ⇒ Boolean
-
.set=(pw) ⇒ Object
set the master password.
- .set? ⇒ Boolean
- .settings ⇒ Object
- .settings=(s) ⇒ Object
Class Method Details
.disable ⇒ Object
41 42 43 44 |
# File 'lib/watobo/gui/utils/master_password.rb', line 41 def self.disable @save_without_master = false @master_password = '' end |
.enable ⇒ Object
46 47 48 |
# File 'lib/watobo/gui/utils/master_password.rb', line 46 def self.enable @save_without_master = true end |
.enabled? ⇒ Boolean
check if master password is set
72 73 74 |
# File 'lib/watobo/gui/utils/master_password.rb', line 72 def self.enabled? return @master_password.empty? end |
.get ⇒ Object
retrieve the master password
67 68 69 |
# File 'lib/watobo/gui/utils/master_password.rb', line 67 def self.get @master_password end |
.save_passwords=(state) ⇒ Object
54 55 56 |
# File 'lib/watobo/gui/utils/master_password.rb', line 54 def self.save_passwords=(state) @save_passwords = state end |
.save_passwords? ⇒ Boolean
50 51 52 |
# File 'lib/watobo/gui/utils/master_password.rb', line 50 def self.save_passwords? @save_passwords end |
.save_without_master=(state) ⇒ Object
58 59 60 |
# File 'lib/watobo/gui/utils/master_password.rb', line 58 def self.save_without_master=(state) @save_without_master = state end |
.save_without_master? ⇒ Boolean
62 63 64 |
# File 'lib/watobo/gui/utils/master_password.rb', line 62 def self.save_without_master? @save_without_master end |
.set=(pw) ⇒ Object
set the master password
29 30 31 32 33 34 |
# File 'lib/watobo/gui/utils/master_password.rb', line 29 def self.set=(pw) @master_password = '' return false unless pw.is_a? String @master_password = pw true end |
.set? ⇒ Boolean
36 37 38 39 |
# File 'lib/watobo/gui/utils/master_password.rb', line 36 def self.set? return false unless @master_password.is_a? String @master_password.empty? end |
.settings ⇒ Object
76 77 78 |
# File 'lib/watobo/gui/utils/master_password.rb', line 76 def self.settings s = { :save_passwords => @save_passwords, :save_without_master => @save_without_master } end |
.settings=(s) ⇒ Object
80 81 82 83 84 85 |
# File 'lib/watobo/gui/utils/master_password.rb', line 80 def self.settings=(s) return false unless s.is_a? Hash @save_passwords = s[:save_passwords] if s.has_key? :save_passwords @save_without_master = s[:save_without_master] if s.has_key? :save_without_master true end |