refactor: rename mail_allowlisted to signup_allowed?
Follow Elixir naming conventions by using question mark suffix for boolean functions. Renamed mail_allowlisted to signup_allowed? and mail_allowlisted_fun to signup_allowed_fun throughout the codebase. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -26,15 +26,15 @@ defmodule BasicSignupAllowlist do
|
||||
## Examples
|
||||
|
||||
iex> System.delete_env("SIGNUP_ALLOWLIST_EMAILS")
|
||||
iex> BasicSignupAllowlist.mail_allowlisted("joe@example.com")
|
||||
iex> BasicSignupAllowlist.signup_allowed?("joe@example.com")
|
||||
false
|
||||
iex> System.put_env("SIGNUP_ALLOWLIST_EMAILS","*")
|
||||
iex> BasicSignupAllowlist.mail_allowlisted("joe@example.com")
|
||||
iex> BasicSignupAllowlist.signup_allowed?("joe@example.com")
|
||||
true
|
||||
|
||||
"""
|
||||
def mail_allowlisted(email) do
|
||||
def signup_allowed?(email) do
|
||||
env_value = System.get_env(@signup_allowlist_emails)
|
||||
mail_allowlisted_fun(env_value, email)
|
||||
signup_allowed_fun(env_value, email)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -9,7 +9,7 @@ defmodule FunCore.BasicSignupAllowlist do
|
||||
|> Enum.map(&normalize/1)
|
||||
end
|
||||
|
||||
def mail_allowlisted_fun(signups_allowed, email_received) do
|
||||
def signup_allowed_fun(signups_allowed, email_received) do
|
||||
case signups_allowed do
|
||||
nil -> false
|
||||
"*" -> true
|
||||
|
||||
Reference in New Issue
Block a user