The purpose of this class is to act as a unifier of the previous and current flash.
Flash means pairs of keys and values that are held only over one request/response cycle. So you can assign a key/value in the current session and retrieve it in the current and following request.
Please see the Innate::Helper::Flash for details on the usage in your application.
flash[key] in your Controller
# File lib/innate/session/flash.rb, line 42 42: def [](key) 43: combined[key] 44: end
flash[key] = value in your Controller
# File lib/innate/session/flash.rb, line 47 47: def []=(key, value) 48: prev = session[:FLASH] || {} 49: prev[key] = value 50: session[:FLASH] = prev 51: end
combined key/value pairs of previous and current current keys overshadow the old ones.
# File lib/innate/session/flash.rb, line 37 37: def combined 38: previous.merge(current) 39: end
the current session[:FLASH]
# File lib/innate/session/flash.rb, line 31 31: def current 32: session[:FLASH] ||= {} 33: end
Delete a key
# File lib/innate/session/flash.rb, line 59 59: def delete(key) 60: previous.delete(key) 61: current.delete(key) 62: end
iterate over the combined session
# File lib/innate/session/flash.rb, line 21 21: def each(&block) 22: combined.each(&block) 23: end
check if combined is empty
# File lib/innate/session/flash.rb, line 65 65: def empty? 66: combined.empty? 67: end
Inspects combined
# File lib/innate/session/flash.rb, line 54 54: def inspect 55: combined.inspect 56: end
merge on current
# File lib/innate/session/flash.rb, line 75 75: def merge(hash) 76: current.merge(hash) 77: end
merge into current
# File lib/innate/session/flash.rb, line 70 70: def merge!(hash) 71: current.merge!(hash) 72: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.