Skip to content

Commit 3912471

Browse files
committed
Use Application.get_env/3 calls instead of module attributes
1 parent 17406a7 commit 3912471

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/nanoid/configuration.ex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ defmodule Nanoid.Configuration do
55

66
## -- DEFAULT ATTRIBUTES
77
@default_mask 63
8-
@default_size Application.get_env(:nanoid, :size, 21)
9-
@default_alphabet Application.get_env(:nanoid, :alphabet, "_-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
8+
@default_size 21
9+
@default_alphabet "_-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
1010
@default_alphabet_length String.length(@default_alphabet)
1111

1212
@doc """
@@ -25,7 +25,7 @@ defmodule Nanoid.Configuration do
2525
21
2626
"""
2727
@spec default_size :: Integer.t()
28-
def default_size, do: @default_size
28+
def default_size, do: Application.get_env(:nanoid, :size, @default_size)
2929

3030
@doc """
3131
Returns the default alphabet of a nanoid used by the generators.
@@ -34,7 +34,7 @@ defmodule Nanoid.Configuration do
3434
"_-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
3535
"""
3636
@spec default_alphabet :: String.t()
37-
def default_alphabet, do: @default_alphabet
37+
def default_alphabet, do: Application.get_env(:nanoid, :alphabet, @default_alphabet)
3838

3939
@doc """
4040
Returns the length of the default alphabet.

0 commit comments

Comments
 (0)