Class: Blobby::InMemoryStore
- Inherits:
-
Object
- Object
- Blobby::InMemoryStore
- Defined in:
- lib/blobby/in_memory_store.rb
Overview
A BLOB store backed by a Hash.
Defined Under Namespace
Classes: StoredObject
Instance Method Summary collapse
- #[](key) ⇒ Object
- #available? ⇒ Boolean
-
#initialize(hash = {}) ⇒ InMemoryStore
constructor
A new instance of InMemoryStore.
Constructor Details
#initialize(hash = {}) ⇒ InMemoryStore
Returns a new instance of InMemoryStore.
9 10 11 |
# File 'lib/blobby/in_memory_store.rb', line 9 def initialize(hash = {}) @hash = hash end |
Instance Method Details
#[](key) ⇒ Object
17 18 19 20 |
# File 'lib/blobby/in_memory_store.rb', line 17 def [](key) KeyConstraint.must_allow!(key) StoredObject.new(@hash, key) end |
#available? ⇒ Boolean
13 14 15 |
# File 'lib/blobby/in_memory_store.rb', line 13 def available? true end |