The couple is here ...
<cfset setSettings(structAppend(getSettings(), { "hello" = "world" })) />
Settings is a struct , but structAppend() returns a boolean value. Add your structure to this line. Secondly, structs are always passed by reference, that is, if you do getSettings() , you get a struct in which you can make changes. Another call to getSettings() returns the same struct with the updated settings.
All you need is:
<cfset structAppend(getSettings(), { "hello" = "world" }) />
Last thing. You can get a null pointer exception because getSettings() starts to be uninitialized. In your cfc in the constructor area (after your properties) you should set the initial struct settings, for example:
<cfset setSettings({}) />
source share