Class: CredStash::Repository
- Inherits:
-
Object
- Object
- CredStash::Repository
- Defined in:
- lib/cred_stash/repository.rb
Defined Under Namespace
Class Method Summary collapse
Instance Method Summary collapse
- #get(name) ⇒ Object
-
#initialize(storage: CredStash::Repository.default_storage) ⇒ Repository
constructor
A new instance of Repository.
- #put(item) ⇒ Object
- #select(name, pluck: nil, limit: nil) ⇒ Object
Constructor Details
#initialize(storage: CredStash::Repository.default_storage) ⇒ Repository
Returns a new instance of Repository.
95 96 97 |
# File 'lib/cred_stash/repository.rb', line 95 def initialize(storage: CredStash::Repository.default_storage) @storage = storage end |
Class Method Details
.default_storage ⇒ Object
91 92 93 |
# File 'lib/cred_stash/repository.rb', line 91 def self.default_storage DynamoDB.new end |
Instance Method Details
#get(name) ⇒ Object
99 100 101 |
# File 'lib/cred_stash/repository.rb', line 99 def get(name) @storage.get(name) end |
#put(item) ⇒ Object
103 104 105 |
# File 'lib/cred_stash/repository.rb', line 103 def put(item) @storage.put(item) end |
#select(name, pluck: nil, limit: nil) ⇒ Object
107 108 109 |
# File 'lib/cred_stash/repository.rb', line 107 def select(name, pluck: nil, limit: nil) @storage.select(name, pluck: pluck, limit: limit) end |