module Roda::RodaPlugins::Flash::InstanceMethods

def _roda_after_40__flash(_)

hash in the session so the next request has access to it.
If the routing doesn't raise an error, rotate the flash
def _roda_after_40__flash(_)
  if f = @_flash
    f = f.next
    if f.empty?
      session.delete('_flash')
    else
      session['_flash'] = f
    end
  end
end

def flash

it from the session if it is not already loaded.
Access the flash hash for the current request, loading
def flash
  # :_flash to support transparent upgrades from previous key
  @_flash ||= FlashHash.new(session['_flash'] || (session['_flash'] = session.delete(:_flash)))
end