Sitemaps.Func (Sitemaps v0.1.2)

Copy Markdown View Source

Func is that module that is usually called utils, common, or another name you can figure it out where you have not to think about to put whatever function you don't know where to put.

Of course, it should be moved to other modules with better names, but at the moment, here they are.

Summary

Functions

Convert boolean value to the string: deny or allow.

Convert if the parameter received is truthy value to ap=1, otherwise ap=0.

Remove useless tags or content from the list of XML.

Get the environment variable passed as parameter. If the value is false or true text it will be converted as boolean. If the value could be a number, it's converted to an integer otherwise it's kept as strings or nil.

Convert the different information about date and times to ISO-8601 format.

Concrete if the value is a number or not.

Join URI data from the two URIs passed as parameters.

Convert boolean value to the string: yes or no.

Functions

allow_deny(arg1)

@spec allow_deny(boolean()) :: String.t()

Convert boolean value to the string: deny or allow.

autoplay(bool)

@spec autoplay(any()) :: String.t()

Convert if the parameter received is truthy value to ap=1, otherwise ap=0.

eraser(elements)

Remove useless tags or content from the list of XML.

get_env(key)

@spec get_env(String.t()) :: boolean() | nil | integer() | String.t()

Get the environment variable passed as parameter. If the value is false or true text it will be converted as boolean. If the value could be a number, it's converted to an integer otherwise it's kept as strings or nil.

iso8601()

iso8601(datetime)

iso8601(year, month, day, hour, minute, second)

Convert the different information about date and times to ISO-8601 format.

numeric?(str)

@spec numeric?(nil | String.t()) :: boolean()

Concrete if the value is a number or not.

url_join(src, dest)

@spec url_join(String.t() | URI.t(), String.t() | URI.t()) :: String.t()

Join URI data from the two URIs passed as parameters.

yes_no(arg1)

@spec yes_no(boolean()) :: String.t()

Convert boolean value to the string: yes or no.