Skip to content

Instantly share code, notes, and snippets.

@diogovk
Last active May 25, 2016 19:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diogovk/465923a612514352b24fc5cd5e98d4fb to your computer and use it in GitHub Desktop.
Save diogovk/465923a612514352b24fc5cd5e98d4fb to your computer and use it in GitHub Desktop.
mini select implementation
def get_by(module, params) do
Enum.find all(module), fn map ->
Enum.all?(params, fn {key, val} -> Map.get(map, key) == val end)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment