Module: MultiModelWizard::Wizard
- Extended by:
- ActiveSupport::Concern
- Includes:
- CookieStore, RedisCookieStore
- Defined in:
- lib/multi_model_wizard/wizard.rb
Constant Summary
Constants included from CookieStore
Instance Attribute Summary collapse
-
#form_id ⇒ Object
readonly
Returns the value of attribute form_id.
Instance Method Summary collapse
-
#clear_session_params ⇒ Object
This clears the form data from the session cookie or redis depending on whats configured.
-
#multi_model_wizard_form_key ⇒ Object
Reference the form key that was passed in from the initializer.
-
#session_params ⇒ Object
This gets the form data from the session cookie or redis depending on whats configured.
-
#set_session_params(value) ⇒ Object
This sets the form data in the session cookie or redis depending on whats configured.
-
#wizard_form_uuid ⇒ Object
Wizard form uuid will attempt to get the uuid from the browser session cookie If one is not there it will set a new session cookie with the uuid as teh value.
Methods included from RedisCookieStore
#clear_redis_cache, #fetch_redis_cache, #set_redis_cache
Methods included from CookieStore
#delete_cookie, #get_signed_cookie, #set_signed_cookie
Instance Attribute Details
#form_id ⇒ Object (readonly)
Returns the value of attribute form_id.
24 25 26 |
# File 'lib/multi_model_wizard/wizard.rb', line 24 def form_id @form_id end |
Instance Method Details
#clear_session_params ⇒ Object
This clears the form data from the session cookie or redis depending on whats configured
32 33 34 |
# File 'lib/multi_model_wizard/wizard.rb', line 32 def clear_session_params store_in_redis? ? clear_redis_session_params : end |
#multi_model_wizard_form_key ⇒ Object
Reference the form key that was passed in from the initializer
52 53 54 |
# File 'lib/multi_model_wizard/wizard.rb', line 52 def multi_model_wizard_form_key ::MultiModelWizard.configuration.form_key end |
#session_params ⇒ Object
This gets the form data from the session cookie or redis depending on whats configured
27 28 29 |
# File 'lib/multi_model_wizard/wizard.rb', line 27 def session_params store_in_redis? ? redis_session_params : end |
#set_session_params(value) ⇒ Object
This sets the form data in the session cookie or redis depending on whats configured
37 38 39 |
# File 'lib/multi_model_wizard/wizard.rb', line 37 def set_session_params(value) store_in_redis? ? set_redis_session_params(value) : (value) end |
#wizard_form_uuid ⇒ Object
Wizard form uuid will attempt to get the uuid from the browser session cookie If one is not there it will set a new session cookie with the uuid as teh value
43 44 45 46 47 48 49 |
# File 'lib/multi_model_wizard/wizard.rb', line 43 def wizard_form_uuid return (wizard_form_key) if (wizard_form_key).present? @uuid ||= SecureRandom.uuid (key: wizard_form_key, value: @uuid) @uuid end |