Permalink
Browse files

Reimplement keys and values on SessionHash

 * Basic additional APIs to simplify requirements for Rails and Devise
  • Loading branch information...
1 parent c56fbf4 commit a6f6801a5a39e1df3d142d123943973a55bae576 @raggi raggi committed Jan 28, 2013
Showing with 12 additions and 0 deletions.
  1. +12 −0 lib/rack/session/abstract/id.rb
@@ -24,6 +24,10 @@ class SessionHash
include Enumerable
attr_writer :id
+ def self.set_options(env, options)
+ env[ENV_SESSION_OPTIONS_KEY] = options.dup
+ end
+
def initialize(store, env)
@store = store
@env = env
@@ -117,6 +121,14 @@ def empty?
@data.empty?
end
+ def keys
+ @data.keys
+ end
+
+ def values
+ @data.values
+ end
+
private
def load_for_read!

0 comments on commit a6f6801

Please sign in to comment.