Module: FlashAnalytics::FlashHashExtensions
- Defined in:
- lib/flash_analytics/flash_hash_extensions.rb
Instance Method Summary collapse
-
#add_analytics_partial(partial, *locals_hash) ⇒ Object
stores the partial name and any local variables in the flash hash will be displayed on the next request.
-
#add_analytics_partial_now(partial, *locals_hash) ⇒ Object
stores the partial name and any local variables in the flash hash will be displayed on the current request.
-
#each(&block) ⇒ Object
exclude flash from flash.each display operations.
- #has_analytics? ⇒ Boolean
Instance Method Details
#add_analytics_partial(partial, *locals_hash) ⇒ Object
stores the partial name and any local variables in the flash hash will be displayed on the next request
13 14 15 16 |
# File 'lib/flash_analytics/flash_hash_extensions.rb', line 13 def add_analytics_partial partial, *locals_hash self["flash_analytics"] ||= {} self["flash_analytics"][partial] = locals_hash[0] end |
#add_analytics_partial_now(partial, *locals_hash) ⇒ Object
stores the partial name and any local variables in the flash hash will be displayed on the current request
20 21 22 23 |
# File 'lib/flash_analytics/flash_hash_extensions.rb', line 20 def add_analytics_partial_now partial, *locals_hash now["flash_analytics"] ||= {} now["flash_analytics"][partial] = locals_hash[0] end |
#each(&block) ⇒ Object
exclude flash from flash.each display operations
25 26 27 |
# File 'lib/flash_analytics/flash_hash_extensions.rb', line 25 def each(&block) @flashes.reject {|k,v| k.to_s == "flash_analytics"}.each(&block) end |
#has_analytics? ⇒ Boolean
7 8 9 |
# File 'lib/flash_analytics/flash_hash_extensions.rb', line 7 def has_analytics? @flashes.key? "flash_analytics" end |