Module: MultiModelWizard::RedisCookieStore

Includes:
CookieStore
Included in:
Wizard
Defined in:
lib/multi_model_wizard/redis_cookie_store.rb

Constant Summary

Constants included from CookieStore

CookieStore::EXPIRATION

Instance Method Summary collapse

Methods included from CookieStore

#delete_cookie, #get_signed_cookie, #set_signed_cookie

Instance Method Details

#clear_redis_cache(key) ⇒ Object

This method is used to delete the form data from redis



22
23
24
# File 'lib/multi_model_wizard/redis_cookie_store.rb', line 22

def clear_redis_cache(key)
  wizard_redis_instance.del(key)
end

#fetch_redis_cache(key) ⇒ Object

This method is used to retrieve the form data from redis



27
28
29
# File 'lib/multi_model_wizard/redis_cookie_store.rb', line 27

def fetch_redis_cache(key)
  wizard_redis_instance.get(key)
end

#set_redis_cache(key, data, expire: ::MultiModelWizard::CookieStore::EXPIRATION) ⇒ Object

Note:

the key of this method is the congifured form key and the uuid for that form session

This method is used to set the form data in redis EXAMPLE: set_redis_cache(‘multi_model_wizard:d5be032f-4863-44e7-87c8-0ec86c85263d’, { hello: ‘world’ })



17
18
19
# File 'lib/multi_model_wizard/redis_cookie_store.rb', line 17

def set_redis_cache(key, data, expire: ::MultiModelWizard::CookieStore::EXPIRATION)
  wizard_redis_instance.set(key, data, ex: expire)
end