Class: Waw::Kern::LivingState::Saved

Inherits:
Object
  • Object
show all
Defined in:
lib/waw/kern/living_state.rb,
lib/waw/kern/living_state.rb

Overview

The living state object itself

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rack_env) ⇒ Saved

Creates a saved instance



13
14
15
# File 'lib/waw/kern/living_state.rb', line 13

def initialize(rack_env)
  @rack_env = rack_env
end

Instance Attribute Details

#rack_envObject (readonly)

Rack environment



10
11
12
# File 'lib/waw/kern/living_state.rb', line 10

def rack_env
  @rack_env
end

Instance Method Details

#rack_requestObject

Current request



18
19
20
# File 'lib/waw/kern/living_state.rb', line 18

def rack_request
  @rack_request ||= Rack::Request.new(rack_env)
end

#rack_responseObject

Current response



23
24
25
# File 'lib/waw/kern/living_state.rb', line 23

def rack_response
  @rack_response ||= Rack::Response.new(rack_env)
end

#rack_sessionObject

Rack session object



28
29
30
# File 'lib/waw/kern/living_state.rb', line 28

def rack_session
  @rack_session ||= (rack_env['rack.session'] ||= {})
end

#waw_sessionObject

Waw session



33
34
35
# File 'lib/waw/kern/living_state.rb', line 33

def waw_session
  @session ||= ::Waw::Session.new(rack_session)
end