Class: Rohbau::DefaultMemoryGateway

Inherits:
Object
  • Object
show all
Defined in:
lib/rohbau/default_memory_gateway.rb

Instance Method Summary collapse

Constructor Details

#initialize(memory = Index.new, services = {}) ⇒ DefaultMemoryGateway

Returns a new instance of DefaultMemoryGateway.



6
7
8
9
# File 'lib/rohbau/default_memory_gateway.rb', line 6

def initialize(memory = Index.new, services = {})
  @memory = memory
  @services = services
end

Instance Method Details

#add(entity) ⇒ Object



15
16
17
# File 'lib/rohbau/default_memory_gateway.rb', line 15

def add(entity)
  @memory.add entity
end

#allObject



39
40
41
# File 'lib/rohbau/default_memory_gateway.rb', line 39

def all
  @memory.all
end

#bulk_add(*entities) ⇒ Object



19
20
21
# File 'lib/rohbau/default_memory_gateway.rb', line 19

def bulk_add(*entities)
  @memory.bulk_add(*entities)
end

#bulk_delete(*uids) ⇒ Object



35
36
37
# File 'lib/rohbau/default_memory_gateway.rb', line 35

def bulk_delete(*uids)
  @memory.bulk_delete(*uids)
end

#delete(uid) ⇒ Object



31
32
33
# File 'lib/rohbau/default_memory_gateway.rb', line 31

def delete(uid)
  @memory.delete(uid)
end

#get(uid) ⇒ Object



23
24
25
# File 'lib/rohbau/default_memory_gateway.rb', line 23

def get(uid)
  @memory.get(uid)
end

#memoryObject



11
12
13
# File 'lib/rohbau/default_memory_gateway.rb', line 11

def memory
  @memory
end

#sizeObject



43
44
45
# File 'lib/rohbau/default_memory_gateway.rb', line 43

def size
  @memory.size
end

#update(entity) ⇒ Object



27
28
29
# File 'lib/rohbau/default_memory_gateway.rb', line 27

def update(entity)
  @memory.update(entity)
end