stripity_stripe v2.0.0-alpha.1 Stripe.Util
Summary
Functions
Performs a root-level conversion of map keys from strings to atoms
Types
Functions
Performs a root-level conversion of map keys from strings to atoms.
This function performs the transformation safely using String.to_existing_atom/1, but this has a possibility to raise if
there is not a corresponding atom.
It is recommended that you pre-filter maps for known values before calling this function.
Examples
iex> map = %{ …> “a”=> %{ …> “b” => %{ …> “c” => 1 …> } …> } …> } iex> Stripe.Util.map_keys_to_atoms(map) %{ a: %{
"b" => %{
"c" => 1
}
} }
stripe_response_to_struct(struct, stripe_response)
stripe_response_to_struct(struct, stripe_response) :: struct