Module: CacheableFlash
- Includes:
- CookieFlash
- Defined in:
- lib/cacheable_flash/config.rb,
lib/cacheable_flash.rb,
lib/cacheable_flash/engine.rb,
lib/cacheable_flash/railtie.rb,
lib/cacheable_flash/version.rb,
lib/cacheable_flash/middleware.rb,
lib/cacheable_flash/cookie_flash.rb,
lib/cacheable_flash/test_helpers.rb,
lib/cacheable_flash/rspec_matchers.rb,
lib/generators/cacheable_flash/install/install_generator.rb
Overview
NOTE: the CacheableFlash::Config class is experimental, and no code uses the config settings yet. So using config values will do nothing as of now. These are ust some ideas of what could be…
Defined Under Namespace
Modules: CookieFlash, RspecMatchers, TestHelpers Classes: Config, Engine, InstallGenerator, Middleware, Railtie
Constant Summary collapse
- VERSION =
"0.3.3"
Class Method Summary collapse
- .included(base) ⇒ Object
-
.stacking ⇒ Object
simply abstracts the StackableFlash.stacking method.
Instance Method Summary collapse
Methods included from CookieFlash
Class Method Details
.included(base) ⇒ Object
25 26 27 28 |
# File 'lib/cacheable_flash.rb', line 25 def self.included(base) #base must define around_filter, as in Rails base.around_filter :write_flash_to_cookie end |
.stacking ⇒ Object
simply abstracts the StackableFlash.stacking method
44 45 46 |
# File 'lib/cacheable_flash.rb', line 44 def self.stacking StackableFlash.stacking end |
Instance Method Details
#write_flash_to_cookie ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/cacheable_flash.rb', line 30 def yield if block_given? # Base must define cookies, as in Rails domain = CacheableFlash::Config.config[:domain] ['flash'] = { :value => (flash, ), :domain => domain } # Base must define flash, as in Rails # TODO: Does not support flash.now feature of the FlashHash in Rails, # because flashes are only removed from cookies when they are used. flash.clear end |