Class: CouchRest::Session::Store
- Inherits:
-
ActionDispatch::Session::AbstractStore
- Object
- ActionDispatch::Session::AbstractStore
- CouchRest::Session::Store
- Defined in:
- lib/couchrest/session/store.rb
Class Method Summary collapse
-
.configure(*args, &block) ⇒ Object
delegate configure to document.
- .set_options(options) ⇒ Object
Instance Method Summary collapse
- #cleanup(rows) ⇒ Object
- #expired ⇒ Object
-
#initialize(app, options = {}) ⇒ Store
constructor
A new instance of Store.
- #never_expiring ⇒ Object
Constructor Details
#initialize(app, options = {}) ⇒ Store
Returns a new instance of Store.
15 16 17 18 |
# File 'lib/couchrest/session/store.rb', line 15 def initialize(app, = {}) super self.class.() end |
Class Method Details
Instance Method Details
#cleanup(rows) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/couchrest/session/store.rb', line 20 def cleanup(rows) rows.each do |row| doc = CouchRest::Session::Document.fetch(row['id']) doc.delete end end |
#expired ⇒ Object
27 28 29 30 |
# File 'lib/couchrest/session/store.rb', line 27 def expired CouchRest::Session::Document.find_by_expires startkey: 1, endkey: Time.now.utc.iso8601 end |
#never_expiring ⇒ Object
32 33 34 |
# File 'lib/couchrest/session/store.rb', line 32 def never_expiring CouchRest::Session::Document.find_by_expires endkey: 1 end |