Class: Egalite::Session

Inherits:
Object show all
Defined in:
lib/egalite/session.rb

Direct Known Subclasses

SessionSequel

Instance Attribute Summary collapse

Instance Method Summary collapse

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, cookies, opts = {})
  @env = env
  @cookies = 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

Returns the value of attribute cookie_name.



6
7
8
# File 'lib/egalite/session.rb', line 6

def cookie_name
  @cookie_name
end

#expire_afterObject

Returns the value of attribute expire_after.



6
7
8
# File 'lib/egalite/session.rb', line 6

def expire_after
  @expire_after
end

#hashObject

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

#createObject

Raises:

  • (NotImplementedError)


19
20
21
# File 'lib/egalite/session.rb', line 19

def create
  raise NotImplementedError
end

#deleteObject

Raises:

  • (NotImplementedError)


28
29
30
# File 'lib/egalite/session.rb', line 28

def delete
  raise NotImplementedError
end

#loadObject

Raises:

  • (NotImplementedError)


22
23
24
# File 'lib/egalite/session.rb', line 22

def load
  raise NotImplementedError
end

#saveObject

Raises:

  • (NotImplementedError)


25
26
27
# File 'lib/egalite/session.rb', line 25

def save
  raise NotImplementedError
end