Class: SimpleEventSourcing::Events::EventStore::RedisClientMock

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_event_sourcing/events/event_store/redis/redis_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRedisClientMock

Returns a new instance of RedisClientMock.



51
52
53
# File 'lib/simple_event_sourcing/events/event_store/redis/redis_client.rb', line 51

def initialize
  @entries = Hash.new()
end

Instance Attribute Details

#entriesObject (readonly)

Returns the value of attribute entries.



49
50
51
# File 'lib/simple_event_sourcing/events/event_store/redis/redis_client.rb', line 49

def entries
  @entries
end

Instance Method Details

#lrange(key, inf, max) ⇒ Object



58
59
60
61
# File 'lib/simple_event_sourcing/events/event_store/redis/redis_client.rb', line 58

def lrange(key,inf,max)
  @entries[key] ||= []
  return @entries[key]
end

#rpush(key, value) ⇒ Object



54
55
56
57
# File 'lib/simple_event_sourcing/events/event_store/redis/redis_client.rb', line 54

def rpush(key, value)
  @entries[key] ||= []
  @entries[key] << value
end