Module: Waw::ScopeUtils

Instance Method Summary collapse

Instance Method Details

#configObject

Returns waw resources



21
22
23
# File 'lib/waw/scope_utils.rb', line 21

def config
  find_kernel_context.config
end

#find_kernel_contextObject Also known as: kernel

Find the kernel context whose call must be delegated to.



5
6
7
8
9
10
# File 'lib/waw/scope_utils.rb', line 5

def find_kernel_context
  return self.waw_kernel if self.respond_to?(:waw_kernel)
  return Waw.kernel if Waw.kernel
  Waw.logger.warn("Using a empty kernel because no one has been found")
  Waw::Kern::App.new("Empty autoloaded kernel").autoload(File.join(File.dirname(__FILE__), 'kern', 'empty'))
end

#loggerObject

Logger to use



26
27
28
# File 'lib/waw/scope_utils.rb', line 26

def logger
  find_kernel_context.logger
end

#paramsObject

Request parameters



53
54
55
# File 'lib/waw/scope_utils.rb', line 53

def params
  find_kernel_context.params
end

#rack_envObject

Returns the current Rack env instance



38
39
40
# File 'lib/waw/scope_utils.rb', line 38

def rack_env
  find_kernel_context.rack_env
end

#real_sessionObject

Returns the current Rack session



60
61
62
# File 'lib/waw/scope_utils.rb', line 60

def real_session
  find_kernel_context.real_session
end

#requestObject

Returns the current Rack request instance



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

def request
  find_kernel_context.request
end

#resourcesObject

Returns waw resources



31
32
33
# File 'lib/waw/scope_utils.rb', line 31

def resources
  find_kernel_context.resources
end

#responseObject

Returns the current Rack request instance



48
49
50
# File 'lib/waw/scope_utils.rb', line 48

def response
  find_kernel_context.response
end

#root_folderObject

Returns the root folder



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

def root_folder
  find_kernel_context.root_folder
end

#sessionObject

Returns the waw session decorator



65
66
67
# File 'lib/waw/scope_utils.rb', line 65

def session
  find_kernel_context.session
end