Class: Chamber::Filters::DecryptionFilter
- Inherits:
-
Object
- Object
- Chamber::Filters::DecryptionFilter
- Defined in:
- lib/chamber/filters/decryption_filter.rb
Constant Summary collapse
- BASE64_STRING_PATTERN =
%r{\A[A-Za-z0-9\+/]{342}==\z}- LARGE_DATA_STRING_PATTERN =
%r{ \A # Beginning of String ( [A-Za-z0-9\+\/#]*\={0,2} # Base64 Encoded Key ) \# # Separator ( [A-Za-z0-9\+\/#]*\={0,2} # Base64 Encoded IV ) \# # Separator ( [A-Za-z0-9\+\/#]*\={0,2} # Base64 Encoded Data ) \z # End of String }x
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#decryption_keys ⇒ Object
readonly
Returns the value of attribute decryption_keys.
-
#secure_key_token ⇒ Object
Returns the value of attribute secure_key_token.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ DecryptionFilter
constructor
A new instance of DecryptionFilter.
Constructor Details
#initialize(options = {}) ⇒ DecryptionFilter
Returns a new instance of DecryptionFilter.
36 37 38 39 40 |
# File 'lib/chamber/filters/decryption_filter.rb', line 36 def initialize( = {}) self.decryption_keys = .fetch(:decryption_keys, {}) || {} self.data = .fetch(:data).dup self.secure_key_token = /\A#{Regexp.escape(options.fetch(:secure_key_prefix))}/ end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
32 33 34 |
# File 'lib/chamber/filters/decryption_filter.rb', line 32 def data @data end |
#decryption_keys ⇒ Object
Returns the value of attribute decryption_keys.
34 35 36 |
# File 'lib/chamber/filters/decryption_filter.rb', line 34 def decryption_keys @decryption_keys end |
#secure_key_token ⇒ Object
Returns the value of attribute secure_key_token.
32 33 34 |
# File 'lib/chamber/filters/decryption_filter.rb', line 32 def secure_key_token @secure_key_token end |
Class Method Details
.execute(options = {}) ⇒ Object
42 43 44 |
# File 'lib/chamber/filters/decryption_filter.rb', line 42 def self.execute( = {}) new().__send__(:execute) end |