Class: ActiveRecordAnonymizer::Encryptor
- Inherits:
-
Object
- Object
- ActiveRecordAnonymizer::Encryptor
- Defined in:
- lib/active_record_anonymizer/encryptor.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
- #encrypt ⇒ Object
-
#initialize(model, attributes) ⇒ Encryptor
constructor
A new instance of Encryptor.
Constructor Details
#initialize(model, attributes) ⇒ Encryptor
Returns a new instance of Encryptor.
7 8 9 10 |
# File 'lib/active_record_anonymizer/encryptor.rb', line 7 def initialize(model, attributes) @model = model @attributes = attributes end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
5 6 7 |
# File 'lib/active_record_anonymizer/encryptor.rb', line 5 def attributes @attributes end |
Instance Method Details
#encrypt ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/active_record_anonymizer/encryptor.rb', line 12 def encrypt if !rails_version_supported? raise ActiveRecordAnonymizer::UnsupportedVersionError, "ActiveRecordAnonymizer relies on Rails 7+ for encrypted columns." end @model.encrypts(*@attributes) end |