module ResponseEncryption
Constants
- ACCESSOR_METHODS
- VERSION
- WRITER_METHODS
Public Class Methods
active_model_serializers?()
click to toggle source
# File lib/response_encryption.rb, line 48 def active_model_serializers? self.serializer_gem == :active_model_serializers end
available_encryption_strategies()
click to toggle source
# File lib/response_encryption.rb, line 36 def available_encryption_strategies %i(encrypted_attributes encrypted_body none) end
available_serializer_gems()
click to toggle source
# File lib/response_encryption.rb, line 32 def available_serializer_gems %i(active_model_serializers jsonapi_resources none) end
cipher()
click to toggle source
# File lib/response_encryption.rb, line 28 def cipher @cipher = OpenSSL::Cipher.new("#{ algothim }-#{ algorithm_key_length }-#{ block_cipher_mode }") end
configure() { |self| ... }
click to toggle source
# File lib/response_encryption.rb, line 22 def configure yield self if block_given? raise "The serializer_gem value is invalid. Please select one of these: #{ available_serializer_gems.join(', ') }" unless available_serializer_gems.include? serializer_gem raise "The available_encryption_strategies value is invalid. Please select one of these: #{ available_serializer_gems.join(', ') }" unless available_encryption_strategies.include? encryption_strategy end
encrypted_attributes_strategy?()
click to toggle source
# File lib/response_encryption.rb, line 40 def encrypted_attributes_strategy? self.encryption_strategy == :encrypted_attributes end
encrypted_body_strategy?()
click to toggle source
# File lib/response_encryption.rb, line 44 def encrypted_body_strategy? self.encryption_strategy == :encrypted_body end
jsonapi_resources?()
click to toggle source
# File lib/response_encryption.rb, line 52 def jsonapi_resources? self.serializer_gem == :jsonapi_resources end