Sha256: 3d84f341ce5e1fb9bcfc689691b144ed6d9177e031d8bdd635296b3ecbb928be

Contents?: true

Size: 671 Bytes

Versions: 24

Compression:

Stored size: 671 Bytes

Contents

rad.html


class PrepareFlash < Rad::Conveyors::Processor

  def call
    workspace.request.must_be.present
    workspace.params.must_be.defined
    
    previous_messages = workspace.request.session.delete 'flash'
    if previous_messages.present?
      previous_messages = JSON.load previous_messages
      rad[:flash] = Rad::Html::Flash.new workspace.params.format, previous_messages
    end
    
    next_processor.call
    
    if rad.include? :flash
      flash = rad[:flash]
      messages = flash.messages_for_next_request
      workspace.request.must_be.present
      workspace.request.session['flash'] = messages.to_json unless messages.empty?
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
rad_core-0.2.6 lib/rad/html/processors/prepare_flash.rb
rad_core-0.2.5 lib/rad/html/processors/prepare_flash.rb
rad_core-0.2.4 lib/rad/html/processors/prepare_flash.rb
rad_core-0.2.3 lib/rad/html/processors/prepare_flash.rb
rad_core-0.2.2 lib/rad/html/processors/prepare_flash.rb
rad_core-0.2.1 lib/rad/html/processors/prepare_flash.rb
rad_core-0.2.0 lib/rad/html/processors/prepare_flash.rb
rad_core-0.0.30 lib/rad/html/processors/prepare_flash.rb
rad_core-0.0.29 lib/rad/html/processors/prepare_flash.rb
rad_core-0.0.28 lib/rad/html/processors/prepare_flash.rb
rad_core-0.0.27 lib/rad/html/processors/prepare_flash.rb
rad_core-0.0.26 lib/rad/html/processors/prepare_flash.rb
rad_core-0.0.25 lib/rad/html/processors/prepare_flash.rb
rad_core-0.0.24 lib/rad/html/processors/prepare_flash.rb
rad_core-0.0.23 lib/rad/html/processors/prepare_flash.rb
rad_core-0.0.22 lib/rad/html/processors/prepare_flash.rb
rad_core-0.0.21 lib/rad/html/processors/prepare_flash.rb
rad_core-0.0.20 lib/rad/html/processors/prepare_flash.rb
rad_core-0.0.19 lib/rad/html/processors/prepare_flash.rb
rad_core-0.0.18 lib/rad/html/processors/prepare_flash.rb