defmodule Slug do def from_string(string) when is_binary(string) do string |> String.downcase() |> String.replace(~r/[\s-]/, "_", global: true) |> String.to_atom() end end