Class: Gitgo::Session

Inherits:
Object
  • Object
show all
Defined in:
lib/gitgo/server.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app, session_env) ⇒ Session

Returns a new instance of Session.



11
12
13
14
15
16
# File 'lib/gitgo/server.rb', line 11

def initialize(app, session_env)
  @app = app
  @session = {}
  @session_env = session_env
  @session_env['rack.session'] = @session
end

Instance Attribute Details

#appObject (readonly)

Returns the value of attribute app.



7
8
9
# File 'lib/gitgo/server.rb', line 7

def app
  @app
end

#sessionObject (readonly)

Returns the value of attribute session.



8
9
10
# File 'lib/gitgo/server.rb', line 8

def session
  @session
end

#session_envObject (readonly)

Returns the value of attribute session_env.



9
10
11
# File 'lib/gitgo/server.rb', line 9

def session_env
  @session_env
end

Instance Method Details

#call(env) ⇒ Object



18
19
20
21
# File 'lib/gitgo/server.rb', line 18

def call(env)
  env.merge!(session_env)
  app.call(env)
end