class MyDemoApp
- MyDemoApp
- Reference
- Object
Overview
This is the class for my demo app! :)
The MyDemoApp
is the primary entry point for using this library, it requires a redis client that
inherits from AbstractRedisClientExpected
to be passed in at the time of initialization.
require "./my_demo_app"
class MyRedisClient < AbstractRedisClientExpected
property cache : Hash(String, String) = {} of String => String
def get(key : String) : String
@cache[key]
end
def set(key : String, value : String)
@cache[key] = value
key
end
end
my_app = MyDemoApp.new(redis_client: MyRedisClient.new)
my_app.random_key_store # => "some_random_key"
Defined in:
lose_the_ruby_accent.crConstructors
-
.new(redis_client : AbstractRedisClientExpected)
This expects a class that represents some kind of redis client.
Instance Method Summary
-
#random_key_store : String
This will let you set a random key/value pair.
-
#set_an_exact_value(key, value) : String
This will let you set an exact key/value pair.
-
#what_was_that?(key) : String
Use this method if you forgot the value that was stored for a key.
Constructor Detail
This expects a class that represents some kind of redis client.
See AbstractRedisClientExpected
for the required method definitions.
Instance Method Detail
This will let you set a random key/value pair.
Why not? 🤷♂️ It's a demo after all! 😁
Use this method if you forgot the value that was stored for a key.
This won't help if you've forgotten your key 😉