capitalize

capitalize() Instance Public methods Converts the first character to uppercase and the remainder to lowercase. 'über'.mb_chars.capitalize.to_s # => "Ãber"

new

new(string) Class Public methods Creates a new Chars instance by wrapping string.

consumes?

consumes?(string) Class Public methods Returns true when the proxy class can handle the string. Returns false otherwise.

verify

verify(signed_message) Instance Public methods

generate

generate(value) Instance Public methods

new

new(secret, options = {}) Class Public methods

encrypt_and_sign

encrypt_and_sign(value) Instance Public methods Encrypt and sign a message. We need to sign the message in order to avoid padding attacks. Reference: www.limited-entropy.com/padding-oracle-attacks.

decrypt_and_verify

decrypt_and_verify(value) Instance Public methods Decrypt and verify a message. We need to verify the message in order to avoid padding attacks. Reference: www.limited-entropy.com/padding-oracle-attacks.

new

new(secret, *signature_key_or_options) Class Public methods Initialize a new MessageEncryptor. secret must be at least as long as the cipher key size. For the default 'aes-256-cbc' cipher, this is 256 bits. If you are using a user-entered secret, you can generate a suitable key with OpenSSL::Digest::SHA256.new(user_secret).digest or similar. Options: :cipher - Cipher to use. Can be any cipher returned by OpenSSL::Cipher.ciphers. Default is 'aes-256-cbc'. :serializer - Object

color

color(text, color, bold=false) Instance Protected methods Set color by using a string or one of the defined constants. If a third option is set to true, it also adds bold to the string. This is based on the Highline implementation and will automatically append CLEAR to the end of the returned String.