Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Elixir 1.17 warnings about fn parentheses #185

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/ex_twilio/result_stream.ex
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ defmodule ExTwilio.ResultStream do
@spec fetch_page(url, module, options :: list) :: {list, {url, module, options :: list}}
defp fetch_page(url, module, options) do
results = Api.get!(url, Api.auth_header(options))
{:ok, items, meta} = Parser.parse_list(results, module, module.resource_collection_name)
{:ok, items, meta} = Parser.parse_list(results, module, module.resource_collection_name())
{items, {next_page_url(meta["next_page_uri"]), module, options}}
end

Expand Down
14 changes: 7 additions & 7 deletions lib/ex_twilio/url_generator.ex
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ defmodule ExTwilio.UrlGenerator do

defp add_segments(url, module, id, options) do
# Append parents
url = url <> build_segments(:parent, normalize_parents(module.parents), options)
url = url <> build_segments(:parent, normalize_parents(module.parents()), options)

# Append module segment
url = url <> segment(:main, {module.resource_name, id})
url = url <> segment(:main, {module.resource_name(), id})

# Append any child segments
url <> build_segments(:child, module.children, options)
url <> build_segments(:child, module.children(), options)
end

@doc """
Expand Down Expand Up @@ -145,7 +145,7 @@ defmodule ExTwilio.UrlGenerator do
@spec resource_collection_name(atom) :: String.t()
def resource_collection_name(module) do
module
|> resource_name
|> resource_name()
|> Macro.underscore()
end

Expand Down Expand Up @@ -184,10 +184,10 @@ defmodule ExTwilio.UrlGenerator do
@spec build_query(atom, list) :: String.t()
defp build_query(module, options) do
special =
module.parents
module.parents()
|> normalize_parents()
|> Enum.map(fn parent -> parent.key end)
|> Enum.concat(module.children)
|> Enum.concat(module.children())
|> Enum.concat([:token])

query =
Expand Down Expand Up @@ -217,7 +217,7 @@ defmodule ExTwilio.UrlGenerator do
defp segment(:main, {key, value}), do: "/#{inflect(key)}/#{value}"

defp segment(:parent, {%ExTwilio.Parent{module: module, key: _key}, value}) do
"/#{module.resource_name}/#{value}"
"/#{module.resource_name()}/#{value}"
end

@spec inflect(String.t() | atom) :: String.t()
Expand Down