Open dcramer opened 13 years ago
Are you suggesting to make gargoyle.get_value('..')
return a value instead of True
/False
?
@anandology only if you configure a non-default return value. In this way Gargoyle could serve as a switches platform with varying responses depending on conditions. It would also make it more suitable for doing things like a/b testing (e.g. maybe under condition a, you want template.html, condition b, template2.html, and condition c template3.html).
Got it.
At openlibrary, we have pluggable conditions that can take parameters, but the return value is always boolean.
Gargoyle should be able to handle values other than True/False for switches. This allows you to avoid duplication of "settings" when you want to say "this is either on, or off, and when its on the value should be FOO".
An example API may look like:
The default values for get_value would be
True
if enabled,False
if not.In the UI upon add/edit switch you'd be able to customize these values. Considerations are if they should only be strings. Otherwise we could allow JSON values but that means you'd be required to quote strings.
We'd also add the ability to set per-condition specific values. So if condition matches foo, the return value is 100 instead of 10.