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
42 43 44 45 |
# File 'lib/watobo/gui/utils/master_password.rb', line 42 def self.disable @save_without_master = false @master_password = '' end |
.enable ⇒ Object
47 48 49 |
# File 'lib/watobo/gui/utils/master_password.rb', line 47 def self.enable @save_without_master = true end |
.enabled? ⇒ Boolean
check if master password is set
73 74 75 |
# File 'lib/watobo/gui/utils/master_password.rb', line 73 def self.enabled? return @master_password.empty? end |
.get ⇒ Object
retrieve the master password
68 69 70 |
# File 'lib/watobo/gui/utils/master_password.rb', line 68 def self.get @master_password end |
.save_passwords=(state) ⇒ Object
55 56 57 |
# File 'lib/watobo/gui/utils/master_password.rb', line 55 def self.save_passwords=(state) @save_passwords = state end |
.save_passwords? ⇒ Boolean
51 52 53 |
# File 'lib/watobo/gui/utils/master_password.rb', line 51 def self.save_passwords? @save_passwords end |
.save_without_master=(state) ⇒ Object
59 60 61 |
# File 'lib/watobo/gui/utils/master_password.rb', line 59 def self.save_without_master=(state) @save_without_master = state end |
.save_without_master? ⇒ Boolean
63 64 65 |
# File 'lib/watobo/gui/utils/master_password.rb', line 63 def self.save_without_master? @save_without_master end |
.set=(pw) ⇒ Object
set the master password
30 31 32 33 34 35 |
# File 'lib/watobo/gui/utils/master_password.rb', line 30 def self.set=(pw) @master_password = '' return false unless pw.is_a? String @master_password = pw true end |
.set? ⇒ Boolean
37 38 39 40 |
# File 'lib/watobo/gui/utils/master_password.rb', line 37 def self.set? return false unless @master_password.is_a? String @master_password.empty? end |
.settings ⇒ Object
77 78 79 |
# File 'lib/watobo/gui/utils/master_password.rb', line 77 def self.settings s = { :save_passwords => @save_passwords, :save_without_master => @save_without_master } end |
.settings=(s) ⇒ Object
81 82 83 84 85 86 |
# File 'lib/watobo/gui/utils/master_password.rb', line 81 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 |