Sha256: 0eb24cc1a1efa7ec681860aa1d417aa32ef2e3874641f31b478575a3f233d052

Contents?: true

Size: 896 Bytes

Versions: 25

Compression:

Stored size: 896 Bytes

Contents

module Mack
  
  # A holder for the session information. This objects gets stored using the Cachetastic system.
  # For more information about how Cachetastic works see the RDoc for that gem.
  # The session cookie name defaults to: _mack_session_id but can be changed using the application_configuration
  # system like such:
  #   mack::session_id: _my_cool_app_sess_id
  class Session
    
    attr_reader :id # The id of the session.
    
    def initialize(id)
      @id = id
      @sess_hash = {}
    end
    
    # Finds what you're looking for in the session, if it exists.
    # If what you're looking for doesn't exist, it returns nil.
    def [](key)
      sess_hash[key.to_sym]
    end
    
    # Sets a value into the session.
    def []=(key, value)
      sess_hash[key.to_sym] = value
    end
    
    private
    attr_reader :sess_hash # :nodoc:
    
  end # Session
  
end # Mack

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
mack-0.0.3 sea_level/session.rb
mack-0.0.4 sea_level/session.rb
mack-0.0.6.2 sea_level/session.rb
mack-0.0.6.1 sea_level/session.rb
mack-0.0.5 sea_level/session.rb
mack-0.1.0 lib/sea_level/session.rb
mack-0.2.0 lib/sea_level/session.rb
mack-0.0.6 sea_level/session.rb
mack-0.0.7.0 lib/sea_level/session.rb
mack-0.2.0.1 lib/sea_level/session.rb
mack-0.4.0 lib/sea_level/session.rb
mack-0.3.0 lib/sea_level/session.rb
mack-0.4.0.1 lib/sea_level/session.rb
mack-0.4.1 lib/sea_level/session.rb
mack-0.4.2.1 lib/sea_level/session.rb
mack-0.4.7 lib/sea_level/session.rb
mack-0.4.6 lib/sea_level/session.rb
mack-0.4.2 lib/sea_level/session.rb
mack-0.4.5 lib/sea_level/session.rb
mack-0.5.5.2 lib/controller/session.rb