Method: ActiveRecord::Encryption::Encryptor#initialize
- Defined in:
- lib/active_record/encryption/encryptor.rb
#initialize(compress: true, compressor: nil) ⇒ Encryptor
Options
-
:compress
- Boolean indicating whether records should be compressed before encryption. Defaults totrue
. -
:compressor
- The compressor to use.-
If compressor is provided, it will be used.
-
If not, it will use ActiveRecord::Encryption.config.compressor which default value is
Zlib
.
If you want to use a custom compressor, it must respond to
deflate
andinflate
. -
25 26 27 28 |
# File 'lib/active_record/encryption/encryptor.rb', line 25 def initialize(compress: true, compressor: nil) @compress = compress @compressor = compressor || ActiveRecord::Encryption.config.compressor end |