Created
June 2, 2022 00:17
-
-
Save vgarro/0631d39c3fc3bacdcdba67b392b6eacb to your computer and use it in GitHub Desktop.
Interface segregation coding challenge
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User | |
def generate_unique_id | |
@unique_id = Digest::MD5.hexdigest("#{name}-#{last_name}") | |
end | |
def confirm_email | |
EmailProcessor.send_email(@email, @unique_id) | |
end | |
end | |
class Admin < User | |
def generate_user_id | |
generate_unique_id | |
end | |
end | |
class Customer < User | |
def send_confirmation_email | |
generate_unique_id | |
confirm_email | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment