Last active
January 26, 2016 13:13
-
-
Save craigp/e957ebeed3cf7355fa1f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Enum.reduce(data, %SomeStruct{}, fn({key, value}, some_struct) -> | |
%{some_struct | (key |> Macro.underscore |> String.to_atom) => value} | |
end) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment