Feature flag
Change Ruby code during runtime
Calling Document.toggle_encryption(state: true)
will change the instance method encrypt
to use StrongEncryptor
implementation. Similarly, calling it with state: false
will change the implementation to use Encryptor
. This is a naive, contrived example that will not work for multi-process production environments, but it is still useful for hacking and debugging.