Module: Ripple::Encryption

Extended by:
ActiveSupport::Concern
Defined in:
lib/rake/migrate.rb,
lib/ripple-encryption.rb,
lib/ripple-encryption/config.rb,
lib/ripple-encryption/errors.rb,
lib/ripple-encryption/version.rb,
lib/ripple-encryption/encryptor.rb,
lib/ripple-encryption/activation.rb,
lib/ripple-encryption/types/json_document.rb,
lib/ripple-encryption/types/binary_document.rb,
lib/ripple-encryption/types/json_serializer.rb,
lib/ripple-encryption/types/binary_serializer.rb,
lib/ripple-encryption/types/encrypted_json_document.rb,
lib/ripple-encryption/types/encrypted_binary_document.rb

Defined Under Namespace

Modules: ClassMethods Classes: BinaryDocument, BinarySerializer, Config, ConfigError, EncryptedBinaryDocument, EncryptedJsonDocument, EncryptedJsonDocumentError, Encryptor, EncryptorConfigError, JsonDocument, JsonSerializer, Migration

Constant Summary collapse

VERSION =
"0.0.4"
@@is_activated =
false

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.activate(path) ⇒ Object



34
35
36
37
38
39
40
41
# File 'lib/ripple-encryption/activation.rb', line 34

def self.activate(path)
  primary_encryptor = nil
  [Ripple::Encryption::JsonSerializer, Ripple::Encryption::BinarySerializer].each do |serializer|
    encryptor = self.load_serializer(serializer, path)
    primary_encryptor if serializer == Ripple::Encryption::JsonSerializer
  end
  primary_encryptor
end

.activated?Boolean

Returns:

  • (Boolean)


43
44
45
# File 'lib/ripple-encryption/activation.rb', line 43

def self.activated?
  @@is_activated
end

Instance Method Details

#update_robjectObject

Overrides the internal method to set the content-type to be encrypted using the default encrypted serializer.



29
30
31
32
# File 'lib/ripple-encryption/activation.rb', line 29

def update_robject
  super
  robject.content_type = @@encrypted_content_type if Ripple::Encryption.activated?
end