-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from dsienkiewicz/issue-13-refactor-start_link
#13 Refactor start link
- Loading branch information
Showing
40 changed files
with
649 additions
and
449 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,3 +46,6 @@ npm-debug.log | |
|
||
# Dotenv files | ||
.env* | ||
|
||
# VSCode | ||
.vscode/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
elixir 1.15.6-otp-26 | ||
erlang 26.1.1 | ||
direnv 2.32.2 |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,23 @@ | ||
defmodule XtbClient.AccountType do | ||
@moduledoc """ | ||
Atoms representing type of account. | ||
Helper module for handling with type of account. | ||
""" | ||
|
||
@type t :: :demo | :real | ||
|
||
@doc """ | ||
Format an atom representing main type of the account to string. | ||
""" | ||
@spec format_main(t()) :: binary() | ||
def format_main(account_type) when is_atom(account_type) do | ||
case account_type do | ||
:demo -> "demo" | ||
:real -> "real" | ||
end | ||
end | ||
@spec format_main(t()) :: String.t() | ||
def format_main(:demo), do: "demo" | ||
def format_main(:real), do: "real" | ||
def format_main(other), do: raise("Unknown account type: #{inspect(other)}") | ||
|
||
@doc """ | ||
Format and atom representing streaming type of the account to string. | ||
""" | ||
@spec format_streaming(t()) :: binary() | ||
def format_streaming(account_type) when is_atom(account_type) do | ||
case account_type do | ||
:demo -> "demoStream" | ||
:real -> "realStream" | ||
end | ||
end | ||
@spec format_streaming(t()) :: String.t() | ||
def format_streaming(:demo), do: "demoStream" | ||
def format_streaming(:real), do: "realStream" | ||
def format_streaming(other), do: raise("Unknown account type: #{inspect(other)}") | ||
end |
Oops, something went wrong.