Module: MongoSessions::MongoStore

Included in:
ActionDispatch::Session::MongoStore
Defined in:
lib/mongo_session_gaggle/mongo.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#collectionObject (readonly)

Returns the value of attribute collection.



20
21
22
# File 'lib/mongo_session_gaggle/mongo.rb', line 20

def collection
  @collection
end

Instance Method Details

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



22
23
24
25
26
27
28
29
# File 'lib/mongo_session_gaggle/mongo.rb', line 22

def initialize(app, options = {})
  unless options[:collection]
    raise 'Collection is a required option via :collection. This gem does not connect to MongoDB itself. You have to ' <<
          'handle that for it. Peace.'
  end
  @collection = options[:collection].respond_to?(:call) ? options[:collection].call : options[:collection]
  super
end