Class: EncryptedField::BasePolicy
- Inherits:
-
Object
- Object
- EncryptedField::BasePolicy
- Defined in:
- lib/encrypted-field/base_policy.rb
Overview
EncryptedField::BasePolicy abstract class for creating encryption policies
Direct Known Subclasses
Instance Attribute Summary collapse
-
#algorithm ⇒ Object
readonly
Returns the value of attribute algorithm.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(algorithm, secret_key, options = {}) ⇒ BasePolicy
constructor
A new instance of BasePolicy.
- #prefix_with_policy_name? ⇒ Boolean
Constructor Details
#initialize(algorithm, secret_key, options = {}) ⇒ BasePolicy
Returns a new instance of BasePolicy.
12 13 14 15 16 |
# File 'lib/encrypted-field/base_policy.rb', line 12 def initialize(algorithm, secret_key, = {}) @algorithm = algorithm @secret_key = secret_key @options = end |
Instance Attribute Details
#algorithm ⇒ Object (readonly)
Returns the value of attribute algorithm.
9 10 11 |
# File 'lib/encrypted-field/base_policy.rb', line 9 def algorithm @algorithm end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
9 10 11 |
# File 'lib/encrypted-field/base_policy.rb', line 9 def @options end |
Instance Method Details
#prefix_with_policy_name? ⇒ Boolean
18 19 20 |
# File 'lib/encrypted-field/base_policy.rb', line 18 def prefix_with_policy_name? .fetch(:prefix_with_policy_name, true) end |