Module ApplicationKernel
In: lib/application_kernel.rb

Mixin module: Supporting methods that provide the intrinsic and elemental platform structure of Code Blue.

Note that the web server must be restarted to recognize changes within this file.

Methods

g   o   s  

Public Instance methods

Interface to: ApplicationController.global_variable()

Get and set global variables.

This method contains no processing logic, it is used only as an interface to expose the method ApplicationController.global_variable().

In order to achieve an array of global variables that are accessible from all controllers and models, but only during the lifetime of the current request, these variables must be stored as an instance variable of the ApplicationController.

All class and instance variables within a module (e.g. mixin files in /lib) are persistent across all requests, and remain in memory until overwritten or the web server is restarted, thus such variables can not be used for this purpose (data that is limited to the process that is managing the current page request and available throughout it‘s entire lifetime, and does not persist across multiple page requests or become available to any other web server process).

[Source]

    # File lib/application_kernel.rb, line 27
27:   def g (
28:     *arguments
29:   )
30:     ApplicationController.global_variable(arguments)
31:   end

Interface to: $o

Simplify calls of the format:

  • $o[<index>][<module option name>][‘value’]

[Source]

    # File lib/application_kernel.rb, line 40
40:   def o (
41:     option
42:   )
43:     if ($o["#{g('application', 'module_option_index')}"]["#{option}"])
44:       return $o["#{g('application', 'module_option_index')}"]["#{option}"]['value']
45:     else
46:       return FALSE
47:     end
48:   end

Interface to: g()

This method provides a global counter.

[Source]

    # File lib/application_kernel.rb, line 56
56:   def s (
57:     id
58:   )
59:     (g('application', id)) ? (count = g('application', id) + 1) : (count = 1)
60:     g('application', id, count)
61:   end

[Validate]