Class: Ripple::SessionStore

Inherits:
ActionDispatch::Session::AbstractStore
  • Object
show all
Defined in:
riak-sessions/lib/ripple/session_store.rb

Overview

A Rails 3-compatible, Riak-backed session store.

Instance Method Summary (collapse)

Constructor Details

- (SessionStore) initialize(app, options = {})

A new instance of SessionStore



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'riak-sessions/lib/ripple/session_store.rb', line 25

def initialize(app, options={})
  super
  @default_options = {
    :bucket => "_sessions",
    :r => 1,
    :w => 1,
    :dw => 0,
    :rw => 1,
    :n_val => 2,
    :last_write_wins => false,
    :host => "127.0.0.1",
    :http_port => 8098
  }.merge(@default_options)
  @client = Riak::Client.new(@default_options.slice(*Riak::Client::VALID_OPTIONS))
  @bucket = @client.bucket(@default_options[:bucket])
  set_bucket_defaults
end