Sha256: f4e5a0bfe302a84aedfd1a33ea6648d215f3338857676df0ae3c347e9876cd25

Contents?: true

Size: 479 Bytes

Versions: 5

Compression:

Stored size: 479 Bytes

Contents

class Flash
  def initialize(session)
    @session = session
    @last_request = @session['flash'] || {}
    @this_request = {}
  end
  
  def finalize
    @session['flash'] = @this_request
  end
  
  def [](key)
    @this_request[key] || @last_request[key]
  end
  
  def now(key, value)
    @last_request[key] = value
  end
  
  def []=(key, value)
    @this_request[key] = value
  end
  
  def delete(key)
    @this_request.delete(key)
    @last_request.delete(key)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
yodel-0.0.7 lib/yodel/request/flash.rb
yodel-0.0.4 lib/yodel/request/flash.rb
yodel-0.0.3 lib/yodel/request/flash.rb
yodel-0.0.2 lib/yodel/request/flash.rb
yodel-0.0.1 lib/yodel/request/flash.rb