Class: MacKeychain::Key
- Inherits:
-
Object
- Object
- MacKeychain::Key
- Defined in:
- lib/mac_keychain.rb
Overview
A Key is an existing item in Keychain, contains item reference and password
Instance Attribute Summary collapse
-
#item ⇒ Object
readonly
Returns the value of attribute item.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(item, password) ⇒ Key
constructor
:item => Keychain item :password => password of item.
Constructor Details
#initialize(item, password) ⇒ Key
:item => Keychain item :password => password of item
24 25 26 27 |
# File 'lib/mac_keychain.rb', line 24 def initialize(item, password) @item = item @password = password end |
Instance Attribute Details
#item ⇒ Object (readonly)
Returns the value of attribute item.
20 21 22 |
# File 'lib/mac_keychain.rb', line 20 def item @item end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
20 21 22 |
# File 'lib/mac_keychain.rb', line 20 def password @password end |
Class Method Details
.create(data) ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/mac_keychain.rb', line 10 def self.create(data) password_length = data.shift password_data = data.shift #password data item = data.shift #SecKeychainItemRef password = if password_data password_data.bytestr(password_length) end self.new(item, password) end |