Class: CloudEncryptedSync::AdapterLiaison
- Inherits:
-
Object
- Object
- CloudEncryptedSync::AdapterLiaison
- Includes:
- Singleton
- Defined in:
- lib/cloud_encrypted_sync/adapter_liaison.rb
Instance Method Summary collapse
- #adapters ⇒ Object
- #delete(key) ⇒ Object
-
#initialize ⇒ AdapterLiaison
constructor
A new instance of AdapterLiaison.
- #key_exists?(key) ⇒ Boolean
- #pull(key) ⇒ Object
- #push(data, key) ⇒ Object
Constructor Details
#initialize ⇒ AdapterLiaison
5 6 7 |
# File 'lib/cloud_encrypted_sync/adapter_liaison.rb', line 5 def initialize find_and_require_adapters end |
Instance Method Details
#adapters ⇒ Object
25 26 27 |
# File 'lib/cloud_encrypted_sync/adapter_liaison.rb', line 25 def adapters Adapters::Template.children end |
#delete(key) ⇒ Object
17 18 19 |
# File 'lib/cloud_encrypted_sync/adapter_liaison.rb', line 17 def delete(key) adapter.delete(key) end |
#key_exists?(key) ⇒ Boolean
21 22 23 |
# File 'lib/cloud_encrypted_sync/adapter_liaison.rb', line 21 def key_exists?(key) adapter.key_exists?(key) end |
#pull(key) ⇒ Object
13 14 15 |
# File 'lib/cloud_encrypted_sync/adapter_liaison.rb', line 13 def pull(key) Cryptographer.decrypt_data(adapter.read(key)) end |
#push(data, key) ⇒ Object
9 10 11 |
# File 'lib/cloud_encrypted_sync/adapter_liaison.rb', line 9 def push(data,key) adapter.write(Cryptographer.encrypt_data(data),key) end |