From be97188762008ad74381d9021f8f964d88751f9e Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Mon, 29 Jul 2024 16:44:20 -0400 Subject: [PATCH] Add private method declaration --- app/models/concerns/canonical_email.rb | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/app/models/concerns/canonical_email.rb b/app/models/concerns/canonical_email.rb index 69d00a804cf..0a1d94ebb1d 100644 --- a/app/models/concerns/canonical_email.rb +++ b/app/models/concerns/canonical_email.rb @@ -4,13 +4,6 @@ module CanonicalEmail extend ActiveSupport::Concern class_methods do - def email_to_canonical_email(str) - username, domain = str.downcase.split('@', 2) - username, = username.delete('.').split('+', 2) - - "#{username}@#{domain}" - end - def email_to_canonical_email_hash(str) Digest::SHA2 .new(256) @@ -18,5 +11,14 @@ module CanonicalEmail email_to_canonical_email(str) ) end + + private + + def email_to_canonical_email(str) + username, domain = str.downcase.split('@', 2) + username, = username.delete('.').split('+', 2) + + "#{username}@#{domain}" + end end end