Class: Egalite::Session
Direct Known Subclasses
Instance Attribute Summary collapse
-
#cookie_name ⇒ Object
Returns the value of attribute cookie_name.
-
#expire_after ⇒ Object
Returns the value of attribute expire_after.
-
#hash ⇒ Object
Returns the value of attribute hash.
Instance Method Summary collapse
- #[](k) ⇒ Object
- #[]=(k, v) ⇒ Object
- #create ⇒ Object
- #delete ⇒ Object
-
#initialize(env, cookies, opts = {}) ⇒ Session
constructor
A new instance of Session.
- #load ⇒ Object
- #save ⇒ Object
Constructor Details
#initialize(env, cookies, opts = {}) ⇒ Session
Returns a new instance of Session.
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/egalite/session.rb', line 8 def initialize(env, , opts = {}) @env = env @cookies = @cookie_name = opts[:cookie_name] || 'egalite_session' @expire_after = opts[:expire_after] || (86400 * 30) @individual_expire = opts[:individual_expire] @secure = opts[:secure] || false @path = opts[:path] || '/' @hash = {} @loaded = false end |
Instance Attribute Details
#cookie_name ⇒ Object
Returns the value of attribute cookie_name.
6 7 8 |
# File 'lib/egalite/session.rb', line 6 def @cookie_name end |
#expire_after ⇒ Object
Returns the value of attribute expire_after.
6 7 8 |
# File 'lib/egalite/session.rb', line 6 def expire_after @expire_after end |
#hash ⇒ Object
Returns the value of attribute hash.
6 7 8 |
# File 'lib/egalite/session.rb', line 6 def hash @hash end |
Instance Method Details
#[](k) ⇒ Object
31 32 33 |
# File 'lib/egalite/session.rb', line 31 def [](k) @hash[k] end |
#[]=(k, v) ⇒ Object
34 35 36 |
# File 'lib/egalite/session.rb', line 34 def []=(k,v) @hash[k] = v end |
#create ⇒ Object
19 20 21 |
# File 'lib/egalite/session.rb', line 19 def create raise NotImplementedError end |
#delete ⇒ Object
28 29 30 |
# File 'lib/egalite/session.rb', line 28 def delete raise NotImplementedError end |
#load ⇒ Object
22 23 24 |
# File 'lib/egalite/session.rb', line 22 def load raise NotImplementedError end |
#save ⇒ Object
25 26 27 |
# File 'lib/egalite/session.rb', line 25 def save raise NotImplementedError end |