Class: ActionController::Session::DatamapperStore

Inherits:
AbstractStore
  • Object
show all
Defined in:
lib/datamapper4rails/datamapper_store.rb

Constant Summary collapse

SecureRandom =
if defined?(::SecureRandom)
  # Use Ruby's SecureRandom library if available.
  ::SecureRandom
else
  # try if there is active support around ;-)
  require 'active_support'
  ::ActiveSupport::SecureRandom
end

Instance Method Summary collapse

Constructor Details

#initialize(app, options = {}) ⇒ DatamapperStore

Returns a new instance of DatamapperStore.



21
22
23
24
25
26
27
28
29
# File 'lib/datamapper4rails/datamapper_store.rb', line 21

def initialize(app, options = {})
  super

  id_generator = Proc.new do
    SecureRandom.hex(16)
  end
  @store = ::DataMapper::Session::Abstract::Store.new(app, options, id_generator)
  @options = options
end