Class: Padrino::Flash::Storage

### Home Classes Methods

### In Files

- lib/padrino-core/application/flash.rb

### Parent

Object

### Methods

- ::new
- #[]
- #[]=
- #clear
- #delete
- #discard
- #each
- #empty?
- #error
- #error=
- #keep
- #key?
- #keys
- #length
- #merge!
- #next
- #notice
- #notice=
- #now
- #replace
- #size
- #success
- #success=
- #sweep
- #to_hash
- #to_s
- #update

### Included Modules

- Enumerable

### Files

- README.rdoc

### Class/Module Index

Quicksearch

- Padrino
- Padrino::Application
- Padrino::ApplicationLoadError
- Padrino::ApplicationSetup
- Padrino::ApplicationSetup::ClassMethods
- Padrino::AuthenticityToken
- Padrino::Cli
- Padrino::Cli::Adapter
- Padrino::Cli::Base
- Padrino::Cli::Launcher
- Padrino::Filter
- Padrino::Flash
- Padrino::Flash::Helpers
- Padrino::Flash::Storage
- Padrino::Loader
- Padrino::Logger
- Padrino::Logger::Colorize
- Padrino::Logger::Extensions
- Padrino::Logger::Rack
- Padrino::Module
- Padrino::Mounter
- Padrino::Mounter::ApplicationWrapper
- Padrino::Mounter::MounterException
- Padrino::ParamsProtection
- Padrino::ParamsProtection::ClassMethods
- Padrino::ParamsProtection::InstanceMethods
- Padrino::Reloader
- Padrino::Reloader::Rack
- Padrino::Reloader::Storage
- Padrino::Router
- Padrino::Routing
- Padrino::Routing::ClassMethods
- Padrino::Routing::InstanceMethods
- Padrino::Routing::Parent
- Padrino::Routing::UnrecognizedException
- Padrino::Server
- Padrino::ShowExceptions
- Padrino::Tasks
- HttpRouter
- HttpRouter::Node
- HttpRouter::Node::FreeRegex
- HttpRouter::Node::Glob
- HttpRouter::Node::Path
- HttpRouter::Node::SpanningRegex
- HttpRouter::Request
- HttpRouter::Route
- Sinatra
- Sinatra::Base
- Sinatra::Request
- Kernel
- Object
- PadrinoTasks

No matching classes.

# Padrino::Flash::Storage

### Public Class Methods

new(session=nil) click to toggle source

@private

    # File lib/padrino-core/application/flash.rb, line 17
    def initialize(session=nil)
      @_now  = session || {}
      @_next = {}
    end

### Public Instance Methods

[](type) click to toggle source

@since 0.10.8 @api public

    # File lib/padrino-core/application/flash.rb, line 32
    def [](type)
      @_now[type]
    end

[]=(type, message) click to toggle source

@since 0.10.8 @api public

    # File lib/padrino-core/application/flash.rb, line 38
    def []=(type, message)
      @_next[type] = message
    end

clear() click to toggle source

@since 0.10.8 @api public

    # File lib/padrino-core/application/flash.rb, line 114
    def clear
      @_now.clear
    end

delete(type) click to toggle source

@since 0.10.8 @api public

    # File lib/padrino-core/application/flash.rb, line 44
    def delete(type)
      @_now.delete(type)
      self
    end

discard(key = nil) click to toggle source

@since 0.10.8 @api public

    # File lib/padrino-core/application/flash.rb, line 103
    def discard(key = nil)
      if key
        @_next.delete(key)
      else
        @_next = {}
      end
      self
    end

each(&block) click to toggle source

@since 0.10.8 @api public

    # File lib/padrino-core/application/flash.rb, line 63
    def each(&block)
      @_now.each(&block)
    end

empty?() click to toggle source

@since 0.10.8 @api public

    # File lib/padrino-core/application/flash.rb, line 120
    def empty?
      @_now.empty?
    end

error() click to toggle source

@since 0.10.8 @api public

    # File lib/padrino-core/application/flash.rb, line 149
    def error
      self[:error]
    end

error=(message) click to toggle source

@since 0.10.8 @api public

    # File lib/padrino-core/application/flash.rb, line 143
    def error=(message)
      self[:error] = message
    end

keep(key = nil) click to toggle source

@since 0.10.8 @api public

    # File lib/padrino-core/application/flash.rb, line 92
    def keep(key = nil)
      if key
        @_next[key] = @_now[key]
      else
        @_next.merge!(@_now)
      end
      self
    end

key?(type) click to toggle source

@since 0.10.8 @api public

    # File lib/padrino-core/application/flash.rb, line 57
    def key?(type)
      @_now.key?(type)
    end

keys() click to toggle source

@since 0.10.8 @api public

    # File lib/padrino-core/application/flash.rb, line 51
    def keys
      @_now.keys
    end

length() click to toggle source

    # File lib/padrino-core/application/flash.rb, line 130
    def length
      @_now.length
    end

Also aliased as: size
merge!(hash) click to toggle source
Alias for: update
next() click to toggle source

    # File lib/padrino-core/application/flash.rb, line 26
    def next
      @_next
    end

notice() click to toggle source

@since 0.10.8 @api public

    # File lib/padrino-core/application/flash.rb, line 161
    def notice
      self[:notice]
    end

notice=(message) click to toggle source

@since 0.10.8 @api public

    # File lib/padrino-core/application/flash.rb, line 155
    def notice=(message)
      self[:notice] = message
    end

now() click to toggle source

    # File lib/padrino-core/application/flash.rb, line 22
    def now
      @_now
    end

replace(hash) click to toggle source

@since 0.10.8 @api public

    # File lib/padrino-core/application/flash.rb, line 69
    def replace(hash)
      @_now.replace(hash)
      self
    end

size() click to toggle source
Alias for: length
success() click to toggle source

@since 0.10.8 @api public

    # File lib/padrino-core/application/flash.rb, line 173
    def success
      self[:success]
    end

success=(message) click to toggle source

@since 0.10.8 @api public

    # File lib/padrino-core/application/flash.rb, line 167
    def success=(message)
      self[:success] = message
    end

sweep() click to toggle source

@since 0.10.8 @api public

    # File lib/padrino-core/application/flash.rb, line 84
    def sweep
      @_now.replace(@_next)
      @_next = {}
      self
    end

to_hash() click to toggle source

@since 0.10.8 @api public

    # File lib/padrino-core/application/flash.rb, line 126
    def to_hash
      @_now.dup
    end

to_s() click to toggle source

@since 0.10.8 @api public

    # File lib/padrino-core/application/flash.rb, line 137
    def to_s
      @_now.to_s
    end

update(hash) click to toggle source

@since 0.10.8 @api public

    # File lib/padrino-core/application/flash.rb, line 76
    def update(hash)
      @_now.update(hash)
      self
    end

Also aliased as: merge!

[Validate]

Generated with the Darkfish Rdoc Generator 2.