Skip to content

Commit

Permalink
application environment format changes
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasvegi authored Sep 18, 2023
1 parent 4e70b0b commit 0648c47
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/elixir/pages/anti-patterns/design-anti-patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ The [*application environment*](https://hexdocs.pm/elixir/1.15/Application.html#

#### Example

The `DashSplitter` module represents a library that configures the behavior of its functions through the global *Application Environment* mechanism. These configurations are concentrated in the *config/config.exs* file, shown below:
The `DashSplitter` module represents a library that configures the behavior of its functions through the global application environment mechanism. These configurations are concentrated in the *config/config.exs* file, shown below:

```elixir
import Config
Expand All @@ -296,7 +296,7 @@ config :app_config,
import_config "#{config_env()}.exs"
```

One of the functions implemented by the `DashSplitter` library is `split/1`. This function aims to separate a string received via a parameter into a certain number of parts. The character used as a separator in `split/1` is always `"-"` and the number of parts the string is split into is defined globally by the *Application Environment*. This value is retrieved by the `split/1` function by calling `Application.fetch_env!/2`, as shown next:
One of the functions implemented by the `DashSplitter` library is `split/1`. This function aims to separate a string received via a parameter into a certain number of parts. The character used as a separator in `split/1` is always `"-"` and the number of parts the string is split into is defined globally by the application environment. This value is retrieved by the `split/1` function by calling `Application.fetch_env!/2`, as shown next:

```elixir
defmodule DashSplitter do
Expand Down

0 comments on commit 0648c47

Please sign in to comment.