cloudinex v0.6.0 Cloudinex.Helpers View Source

These are helper functions that assist with handling responses and creating requests

Link to this section Summary

Functions

Atomizes an enumerable

Handles any method with !

Handles the response from the form url encoded upload

Handles any normal response

Joins enumerable

Maps context

Maps coordinates

Prepares options for POST upload

Takes parameters and creates signature per Cloudinary docs

Converts Enumerable of tuples to key value map

Link to this section Functions

Link to this function atomize(item) View Source
atomize(item :: List.t() | Map.t()) :: Map.t()

Atomizes an enumerable

Link to this function base_image_url() View Source
base_image_url() :: String.t()
Link to this function cloud_name() View Source
cloud_name() :: String.t()
Link to this function crypto_hash(query) View Source
crypto_hash(query :: String.t()) :: String.t()
Link to this function handle_bang_response(env) View Source
handle_bang_response(env :: Map.t()) :: String.t() | RuntimeError

Handles any method with !

Link to this function handle_json_response(env) View Source
handle_json_response(env :: Map.t()) :: {atom(), String.t()}

Handles the response from the form url encoded upload

Link to this function handle_response(env) View Source
handle_response(env :: Map.t()) :: {atom(), String.t()}

Handles any normal response

Link to this function join_list(list) View Source
join_list(list :: Enum.t()) :: String.t()

Joins enumerable

Link to this function map_context(context) View Source
map_context(context :: Map.t()) :: String.t()

Maps context

Link to this function map_coordinates(coordinates) View Source
map_coordinates(coordinates :: List.t()) :: String.t()

Maps coordinates

Link to this function prepare_opts(options) View Source
prepare_opts(options :: Map.t()) :: Map.t()

Prepares options for POST upload

Link to this function sign(data) View Source
sign(data :: Map.t()) :: Map.t()

Takes parameters and creates signature per Cloudinary docs

Link to this function unify(data) View Source
unify(data :: Enum.t()) :: Map.t()

Converts Enumerable of tuples to key value map

  %{"first" => "value"} = Cloudinex.Helpers.unify([first: "value"])