soundcloud v0.1.0 Soundcloud.HashConversions View Source

Link to this section Summary

Functions

Convert a set of key, value parameters into a map suitable for passing into requests. This will convert lists into the syntax required by SoundCloud. Heavily lifeted from HTTParty

Returns a map with every key-value pair in map mapped with normalize_param

Link to this section Functions

Link to this function normalize_param(key, value) View Source

Convert a set of key, value parameters into a map suitable for passing into requests. This will convert lists into the syntax required by SoundCloud. Heavily lifeted from HTTParty.

Examples

iex> Soundcloud.HashConversions.normalize_param("oauth_token", "foo")
%{"oauth_token" => "foo"}

iex> Soundcloud.HashConversions.normalize_param("playlist[tracks]", [1234, 4567])
%{"playlist[tracks][]" => [1234, 4567]}
Link to this function to_params(map) View Source
to_params(%{}) :: %{}

Returns a map with every key-value pair in map mapped with normalize_param.

Examples

iex> Soundcloud.HashConversions.to_params(%{"foo" => %{"bar" => %{"a" => 5}, "tar" => [1, 2]}})
%{"foo[tar][]" => [1, 2]}