Class: OnePassword::Profile
- Inherits:
-
Object
- Object
- OnePassword::Profile
- Defined in:
- lib/one_password/profile.rb
Instance Attribute Summary collapse
-
#directory ⇒ Object
readonly
Returns the value of attribute directory.
-
#encryption_keys ⇒ Object
readonly
Returns the value of attribute encryption_keys.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #all ⇒ Object
- #all_encryption_keys ⇒ Object
- #contents ⇒ Object
- #encryption_keys_loaded? ⇒ Boolean
-
#initialize(keychain, directory) ⇒ Profile
constructor
A new instance of Profile.
- #password ⇒ Object
- #password=(password) ⇒ Object
Constructor Details
#initialize(keychain, directory) ⇒ Profile
Returns a new instance of Profile.
8 9 10 11 12 |
# File 'lib/one_password/profile.rb', line 8 def initialize(keychain, directory) @keychain = keychain @name = File.basename(directory) @directory = Pathname(directory) end |
Instance Attribute Details
#directory ⇒ Object (readonly)
Returns the value of attribute directory.
14 15 16 |
# File 'lib/one_password/profile.rb', line 14 def directory @directory end |
#encryption_keys ⇒ Object
Returns the value of attribute encryption_keys.
14 15 16 |
# File 'lib/one_password/profile.rb', line 14 def encryption_keys @encryption_keys end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
14 15 16 |
# File 'lib/one_password/profile.rb', line 14 def name @name end |
Instance Method Details
#all ⇒ Object
21 22 23 24 |
# File 'lib/one_password/profile.rb', line 21 def all load_contents unless @all @all end |
#all_encryption_keys ⇒ Object
31 32 33 34 |
# File 'lib/one_password/profile.rb', line 31 def all_encryption_keys load_encryption_keys unless @all_encryption_keys @all_encryption_keys end |
#contents ⇒ Object
16 17 18 19 |
# File 'lib/one_password/profile.rb', line 16 def contents load_contents unless @contents @contents end |
#encryption_keys_loaded? ⇒ Boolean
36 37 38 |
# File 'lib/one_password/profile.rb', line 36 def encryption_keys_loaded? !!@encryption_keys end |
#password ⇒ Object
40 41 42 43 |
# File 'lib/one_password/profile.rb', line 40 def password raise NoPassword unless @password @password end |
#password=(password) ⇒ Object
45 46 47 |
# File 'lib/one_password/profile.rb', line 45 def password=(password) @password = password end |