Class: Mandy::Stores::InMemory
- Inherits:
-
Object
- Object
- Mandy::Stores::InMemory
- Defined in:
- lib/mandy/stores/in_memory.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #get(key) ⇒ Object
-
#initialize(options = {}) ⇒ InMemory
constructor
A new instance of InMemory.
- #put(key, values) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ InMemory
Returns a new instance of InMemory.
6 7 8 9 |
# File 'lib/mandy/stores/in_memory.rb', line 6 def initialize(={}) @options = @table = {} end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'lib/mandy/stores/in_memory.rb', line 4 def @options end |
Instance Method Details
#==(other) ⇒ Object
19 20 21 |
# File 'lib/mandy/stores/in_memory.rb', line 19 def ==(other) self.class == other.class && self. == other. end |
#get(key) ⇒ Object
11 12 13 |
# File 'lib/mandy/stores/in_memory.rb', line 11 def get(key) @table[key.to_s] end |
#put(key, values) ⇒ Object
15 16 17 |
# File 'lib/mandy/stores/in_memory.rb', line 15 def put(key, values) @table[key.to_s] = values end |