Class: Mandy::Stores::InMemory

Inherits:
Object
  • Object
show all
Defined in:
lib/mandy/stores/in_memory.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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={})
  @options = options
  @table = {}
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



4
5
6
# File 'lib/mandy/stores/in_memory.rb', line 4

def options
  @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.options == other.options
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