Sha256: 146d29896fcda517355865018341f86bc019e02bb1358b4487edf2aafa5b85c9

Contents?: true

Size: 669 Bytes

Versions: 3

Compression:

Stored size: 669 Bytes

Contents

module PluginAWeek #:nodoc:
  module EncryptedStrings
    # Represents the base class for all encryptors.  By default, all encryptors
    # are assumed to be able to decrypt strings.  Note, however, that certain
    # encryption algorithms do not allow decryption.
    class Encryptor
      # Can this string be decrypted?  Default is true.
      def can_decrypt?
        true
      end
      
      # Attempts to decrypt the given data using the current configuration.  By
      # default, decryption is not implemented.
      def decrypt(data)
        raise NotImplementedError, "Decryption is not supported using a(n) #{self.class.name}"
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
encrypted_strings-0.1.1 lib/encrypted_strings/encryptor.rb
encrypted_strings-0.0.5 lib/encrypted_strings/encryptor.rb
encrypted_strings-0.1.0 lib/encrypted_strings/encryptor.rb