Class: Stimul8::Storage::InMemory

Inherits:
Object
  • Object
show all
Includes:
Stimul8::Storage
Defined in:
lib/stimul8/storage/in_memory.rb

Instance Method Summary collapse

Methods included from Stimul8::Storage

#key_for

Constructor Details

#initializeInMemory

Returns a new instance of InMemory.



6
7
8
# File 'lib/stimul8/storage/in_memory.rb', line 6

def initialize
  @components = {}
end

Instance Method Details

#read(component_id, property_name) ⇒ Object



14
15
16
# File 'lib/stimul8/storage/in_memory.rb', line 14

def read component_id, property_name
  @components[key_for(component_id, property_name)]
end

#write(component_id, property_name, value) ⇒ Object



10
11
12
# File 'lib/stimul8/storage/in_memory.rb', line 10

def write component_id, property_name, value
  @components[key_for(component_id, property_name)] = value
end