I'm building an app that compares statistics from sports games. Each
statistic has an "action" that defines what happened at that point in
time, for example "player has possession" is one such action string.
I use these strings to pull out / sort the statistics into meaningful
information, so these strings are used throughout the app.
I want to know a good place to have a list of global variables like
this. I have tried :
creating file called action_string_constants.rb in /lib.
In this file I declare a module :
MB_ACTION_STRING_PLAYER_HAS_POSSESSION = "player has posession"
I then try and use this in another class such as Player (model) with
However this returns a NameError (uninitialized constant
I then thought of including this in application.rb, as I want to use
these constants in many files, but this returns a similar error when
trying to launch the app.
Where can I declare a string constant??!
This really should be simple!