JikanEx.UrlBuilders (JikanEx v0.1.5) View Source
Creates the URLs for Jikan endpoints. These are called from JikanEx.Request and aren't typically used by calling them directly.
Link to this section Summary
Functions
Builds a URL from a list of paths and a param_map
Similar to build_url/4 but doesn't accept a MAL ID
Build a URL from a function name, (MAL) id, paths, parameter map
Link to this section Functions
Specs
build([JikanEx.Url.path()], JikanEx.Url.parameters()) :: JikanEx.Url.url()
Builds a URL from a list of paths and a param_map
Example
iex> JikanEx.UrlBuilders.build([:user, "nekomata1037", :animelist, :completed, 2], %{year: 2019})
"user/nekomata1037/animelist/completed/2?year=2019&"
Specs
build_url(tuple(), [JikanEx.Url.path()], JikanEx.Url.parameters()) :: JikanEx.Url.url()
Similar to build_url/4 but doesn't accept a MAL ID
Example
iex> JikanEx.UrlBuilders.build_url({:search!, 0}, ["anime"], %{:q => "k-on", "limit" => 5})
"search/anime?q=k-on&limit=5&"
Specs
build_url( tuple(), pos_integer(), [JikanEx.Url.path()], JikanEx.Url.parameters() ) :: JikanEx.Url.url()
Build a URL from a function name, (MAL) id, paths, parameter map
Accepts the __ENV__.function from the calling function as the first argument (to turn into the first URL part), the MAL ID for the second and additional paths/params as third/fourth
Example
iex> JikanEx.UrlBuilders.build_url({:anime!, 0}, 1, [:characters_staff], %{})
"anime/1/characters_staff/"