I’m finalising a translation plugin I use in one app. I’d like the
plugin the be configurable but am not sure how to provide this
configurability. For example, there’s a setting for the cookie name to
use when saving user’s prefered language. I thought of having a class
TranslationConfig like this:
But that implies that if you want to change this setting, you should
reopen the class somewhere (I’m not even sure that putting it in
environment.rb would work as I thought plugins are loaded last).
Also, how can write unit tests for different settings so I can check
that the right cookie name is used? Reopening a class in a method
Any advice on this?