Skip to content

Commit 63cb083

Browse files
Fix missing punctuation [ci-skip]
1 parent de41df5 commit 63cb083

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

activerecord/lib/active_record/encryption/encryptor.rb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module Encryption
1111
# It interacts with a KeyProvider for getting the keys, and delegate to
1212
# ActiveRecord::Encryption::Cipher the actual encryption algorithm.
1313
class Encryptor
14-
# The compressor to use for compressing the payload
14+
# The compressor to use for compressing the payload.
1515
attr_reader :compressor
1616

1717
# === Options
@@ -20,22 +20,22 @@ class Encryptor
2020
# Defaults to +true+.
2121
# * <tt>:compressor</tt> - The compressor to use.
2222
# 1. If compressor is provided, it will be used.
23-
# 2. If not, it will use +ActiveRecord::Encryption.config.compressor+ which default value is +Zlib+.
23+
# 2. If not, it will use +ActiveRecord::Encryption.config.compressor+, which default value is +Zlib+.
2424
# If you want to use a custom compressor, it must respond to +deflate+ and +inflate+.
2525
def initialize(compress: true, compressor: nil)
2626
@compress = compress
2727
@compressor = compressor || ActiveRecord::Encryption.config.compressor
2828
end
2929

30-
# Encrypts +clean_text+ and returns the encrypted result
30+
# Encrypts +clean_text+ and returns the encrypted result.
3131
#
3232
# Internally, it will:
3333
#
34-
# 1. Create a new ActiveRecord::Encryption::Message
35-
# 2. Compress and encrypt +clean_text+ as the message payload
34+
# 1. Create a new ActiveRecord::Encryption::Message.
35+
# 2. Compress and encrypt +clean_text+ as the message payload.
3636
# 3. Serialize it with +ActiveRecord::Encryption.message_serializer+ (+ActiveRecord::Encryption::SafeMarshal+
37-
# by default)
38-
# 4. Encode the result with Base 64
37+
# by default).
38+
# 4. Encode the result with Base64.
3939
#
4040
# === Options
4141
#
@@ -45,25 +45,25 @@ def initialize(compress: true, compressor: nil)
4545
#
4646
# [:cipher_options]
4747
# Cipher-specific options that will be passed to the Cipher configured in
48-
# +ActiveRecord::Encryption.cipher+
48+
# +ActiveRecord::Encryption.cipher+.
4949
def encrypt(clear_text, key_provider: default_key_provider, cipher_options: {})
5050
clear_text = force_encoding_if_needed(clear_text) if cipher_options[:deterministic]
5151

5252
validate_payload_type(clear_text)
5353
serialize_message build_encrypted_message(clear_text, key_provider: key_provider, cipher_options: cipher_options)
5454
end
5555

56-
# Decrypts an +encrypted_text+ and returns the result as clean text
56+
# Decrypts an +encrypted_text+ and returns the result as clean text.
5757
#
5858
# === Options
5959
#
6060
# [:key_provider]
6161
# Key provider to use for the encryption operation. It will default to
62-
# +ActiveRecord::Encryption.key_provider+ when not provided
62+
# +ActiveRecord::Encryption.key_provider+ when not provided.
6363
#
6464
# [:cipher_options]
6565
# Cipher-specific options that will be passed to the Cipher configured in
66-
# +ActiveRecord::Encryption.cipher+
66+
# +ActiveRecord::Encryption.cipher+.
6767
def decrypt(encrypted_text, key_provider: default_key_provider, cipher_options: {})
6868
message = deserialize_message(encrypted_text)
6969
keys = key_provider.decryption_keys(message)
@@ -73,7 +73,7 @@ def decrypt(encrypted_text, key_provider: default_key_provider, cipher_options:
7373
raise Errors::Decryption
7474
end
7575

76-
# Returns whether the text is encrypted or not
76+
# Returns whether the text is encrypted or not.
7777
def encrypted?(text)
7878
deserialize_message(text)
7979
true

0 commit comments

Comments
 (0)