Sha256: 11563100029d752d3ca9edb8a63746a6e6ca9bf5d526d48ffb7647e1fb25a868

Contents?: true

Size: 729 Bytes

Versions: 50

Compression:

Stored size: 729 Bytes

Contents

module Encryptor
  # Adds <tt>encrypt</tt> and <tt>decrypt</tt> methods to strings
  module String
    # Returns a new string containing the encrypted version of itself
    def encrypt(options = {})
      Encryptor.encrypt(options.merge(:value => self))
    end

    # Replaces the contents of a string with the encrypted version of itself
    def encrypt!(options ={})
      replace encrypt(options)
    end

    # Returns a new string containing the decrypted version of itself
    def decrypt(options = {})
      Encryptor.decrypt(options.merge(:value => self))
    end

    # Replaces the contents of a string with the decrypted version of itself
    def decrypt!(options ={})
      replace decrypt(options)
    end
  end
end

Version data entries

50 entries across 50 versions & 3 rubygems

Version Path
classiccms-0.5.14 vendor/bundle/gems/encryptor-1.1.3/lib/encryptor/string.rb
classiccms-0.5.13 vendor/bundle/gems/encryptor-1.1.3/lib/encryptor/string.rb
classiccms-0.5.12 vendor/bundle/gems/encryptor-1.1.3/lib/encryptor/string.rb
classiccms-0.5.11 vendor/bundle/gems/encryptor-1.1.3/lib/encryptor/string.rb
classiccms-0.5.10 vendor/bundle/gems/encryptor-1.1.3/lib/encryptor/string.rb
classiccms-0.5.9 vendor/bundle/gems/encryptor-1.1.3/lib/encryptor/string.rb
classiccms-0.5.8 vendor/bundle/gems/encryptor-1.1.3/lib/encryptor/string.rb
classiccms-0.5.7 vendor/bundle/gems/encryptor-1.1.3/lib/encryptor/string.rb
classiccms-0.5.6 vendor/bundle/gems/encryptor-1.1.3/lib/encryptor/string.rb
classiccms-0.5.5 vendor/bundle/gems/encryptor-1.1.3/lib/encryptor/string.rb
classiccms-0.5.2 vendor/bundle/gems/encryptor-1.1.3/lib/encryptor/string.rb
classiccms-0.5.1 vendor/bundle/gems/encryptor-1.1.3/lib/encryptor/string.rb
classiccms-0.5.0 vendor/bundle/gems/encryptor-1.1.3/lib/encryptor/string.rb
classiccms-0.4.2 vendor/bundle/gems/encryptor-1.1.3/lib/encryptor/string.rb
classiccms-0.4.1 vendor/bundle/gems/encryptor-1.1.3/lib/encryptor/string.rb
classiccms-0.4.0 vendor/bundle/gems/encryptor-1.1.3/lib/encryptor/string.rb
classiccms-0.3.9 vendor/bundle/gems/encryptor-1.1.3/lib/encryptor/string.rb
classiccms-0.3.8 vendor/bundle/gems/encryptor-1.1.3/lib/encryptor/string.rb
classiccms-0.3.7 vendor/bundle/gems/encryptor-1.1.3/lib/encryptor/string.rb
classiccms-0.3.6 vendor/bundle/gems/encryptor-1.1.3/lib/encryptor/string.rb