ex_metra v0.1.1 ExMetra.Utilities

A collection of functions that are used to help with conversions

Link to this section Summary

Functions

Converts any non-integer and not-string values into a boolean. If this is called it will always return false

Convert a string into an integer. It does not check for errors so it will fail when passed in a non-integer string. If you need to check for errors you can use the built in function Integer.parse

Converts a string value into a Time value with no error checking

Link to this section Functions

Link to this function to_boolean!(value)
to_boolean!(Any) :: boolean()
to_boolean!(integer()) :: boolean()
to_boolean!(String.t()) :: boolean()
to_boolean!([String.t()]) :: [boolean()]

Converts any non-integer and not-string values into a boolean. If this is called it will always return false.

Link to this function to_integer!(value)
to_integer!(String.t()) :: integer()

Convert a string into an integer. It does not check for errors so it will fail when passed in a non-integer string. If you need to check for errors you can use the built in function Integer.parse

Link to this function to_time!(value)
to_time!(String.t()) :: Time.t()
to_time!([String.t()]) :: [Time.t()]

Converts a string value into a Time value with no error checking.