Module ApplicationMessages
In: lib/application_messages.rb

Mixin module: Message externalization API.

Messages are stored in an external YAML configuration file, and are indexed using a unique, auto-incrementing integer. This eases message management as no updates are ever required within the ApplicationMessages data model. For example, if a method or message call is moved amongst system libraries no updates are required to the YAML configuration file or this module.

Note that messages must not be stored in the database because they are requisite for basic platform functionality. System messages must be available at all times, if the database were to become unavailable then no message could be retrieved, for example to describe the fact that the database is unavailable.

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

Methods

load   message  

Public Class methods

Load all application messages into the global hash $m.

[Source]

    # File lib/application_messages.rb, line 41
41:   def self.load (
42:     configuration
43:   )
44:     $m = open(configuration) { |f| YAML.load(f) }
45:     TRUE
46:   end

Public Instance methods

Parse application data into an application message and return the result.

[Source]

    # File lib/application_messages.rb, line 29
29:   def message (
30:     *arguments
31:   )
32:     (arguments[0]) ? ($m[arguments.shift].parse_data(arguments)) : (FALSE)
33:   end

[Validate]