Class: Mova::Storage::Readonly
- Inherits:
-
Object
- Object
- Mova::Storage::Readonly
- Defined in:
- lib/mova/storage/readonly.rb
Overview
Wrapper around a storage that protects from writes.
Instance Attribute Summary collapse
- #storage ⇒ Object readonly
Instance Method Summary collapse
- #clear ⇒ void
- #exist?(key) ⇒ Boolean
-
#initialize(storage) ⇒ Readonly
constructor
A new instance of Readonly.
- #read(key) ⇒ String?
- #read_multi(*keys) ⇒ Hash{String => String}
- #write(key, value) ⇒ void
Constructor Details
#initialize(storage) ⇒ Readonly
Returns a new instance of Readonly.
9 10 11 |
# File 'lib/mova/storage/readonly.rb', line 9 def initialize(storage) @storage = storage end |
Instance Attribute Details
#storage ⇒ Object (readonly)
7 8 9 |
# File 'lib/mova/storage/readonly.rb', line 7 def storage @storage end |
Instance Method Details
#clear ⇒ void
Note:
Does nothing
This method returns an undefined value.
42 43 |
# File 'lib/mova/storage/readonly.rb', line 42 def clear end |
#exist?(key) ⇒ Boolean
27 28 29 |
# File 'lib/mova/storage/readonly.rb', line 27 def exist?(key) storage.exist?(key) end |
#read(key) ⇒ String?
15 16 17 |
# File 'lib/mova/storage/readonly.rb', line 15 def read(key) storage.read(key) end |
#read_multi(*keys) ⇒ Hash{String => String}
21 22 23 |
# File 'lib/mova/storage/readonly.rb', line 21 def read_multi(*keys) storage.read_multi(*keys) end |
#write(key, value) ⇒ void
Note:
Does nothing
This method returns an undefined value.
36 37 |
# File 'lib/mova/storage/readonly.rb', line 36 def write(key, value) end |