Module: Waw::EnvironmentUtils

Includes:
ScopeUtils
Included in:
Controller
Defined in:
lib/waw/environment_utils.rb

Overview

Provides environment utilities to get the current Rack environment, session and so on. Some of these utilities make the assumption that a session is installed in some Rack standard way (through Rack::Session::Pool) for example.

Constant Summary collapse

DEPRECATED_MSG =
<<-EOF
  Method ${method_name} is deprecated and will be removed in version 0.3.
  Please include Waw::ScopeUtils module instead.
EOF

Instance Method Summary collapse

Methods included from ScopeUtils

#config, #find_kernel_context, #logger, #params, #rack_env, #real_session, #request, #resources, #response, #root_folder, #session

Instance Method Details

#envObject



16
17
18
# File 'lib/waw/environment_utils.rb', line 16

def env
  rack_env
end

#session_get(key) ⇒ Object



52
53
54
# File 'lib/waw/environment_utils.rb', line 52

def session_get(key)
  session[key]
end

#session_has_key?(key) ⇒ Boolean

Returns:



25
26
27
# File 'lib/waw/environment_utils.rb', line 25

def session_has_key?(key)
  session.has_key?(key)
end

#session_set(key, value) ⇒ Object



34
35
36
# File 'lib/waw/environment_utils.rb', line 34

def session_set(key, value)
  session[key] = value
end

#session_unset(key) ⇒ Object



43
44
45
# File 'lib/waw/environment_utils.rb', line 43

def session_unset(key)
  session.delete(key)
end