fyyd_ex v0.2.2 Fyyd.Utils View Source
Stuff that hasn't found it's place yet.
Link to this section Summary
Functions
Takes a Map, where the keys are Strings, and a List of expected fields. Returns Keyword List, where the keys are atoms
Takes a Keyword List, where the keys are atoms, and a Module name and returns a struct built from them
Link to this section Functions
Link to this function
extract_from_response(data, expected_fields \\ []) View Source
Takes a Map, where the keys are Strings, and a List of expected fields. Returns Keyword List, where the keys are atoms.
Example
iex> Fyyd.Utils.extract_from_response(%{"foo" => "bar"}, ["foo"])
[foo: "bar"]
Link to this function
struct_from_keyword_list(list, module) View Source
Takes a Keyword List, where the keys are atoms, and a Module name and returns a struct built from them.