Parent

Included Modules

Merb::DataMapperSessionStore

Public Class Methods

default_repository_name() click to toggle source
   # File lib/merb_datamapper/data_mapper_session.rb, line 7
7:     def self.default_repository_name
8:       Merb::Plugins.config[:merb_datamapper][:session_repository_name]
9:     end
delete_session(session_id) click to toggle source

Deletes a session with the given id

@param session_id The session to destroy

    # File lib/merb_datamapper/data_mapper_session.rb, line 47
47:     def self.delete_session(session_id)
48:       all(:session_id => session_id).destroy!
49:     end
retrieve_session(session_id) click to toggle source

Retrieves a session from the session store

@param session_id The session_id to retrieve the session for

@returns The session corresponding to the id, or nil

    # File lib/merb_datamapper/data_mapper_session.rb, line 23
23:     def self.retrieve_session(session_id)
24:       if session = get(session_id)
25:         session.data
26:       end
27:     end
store_session(session_id, data) click to toggle source

Stores the data in a session with the given session_id, creating it if required

@param session_id The session_id to find the session by, or the id of the new session @param data The data to be stored in the session. Probably a hash

    # File lib/merb_datamapper/data_mapper_session.rb, line 35
35:     def self.store_session(session_id, data)
36:       if session = get(session_id)
37:         session.update(:data => data)
38:       else
39:         create(:session_id => session_id, :data => data)
40:       end
41:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.