Last active
September 8, 2016 03:49
-
-
Save jeisenberg/67358b863e5aead523af29362d83bfc4 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
def humanizing_operating_hours_without_pipes(hours_map) do | |
grouped = Enum.group_by(hours_map, fn(x) -> elem(x, 1) end, fn(x) -> elem(x,0) end) | |
as_list = Enum.into(grouped, []) | |
final = Enum.map(as_list, fn(x) -> | |
v = elem(x, 1) | |
v_upcase = Enum.map(String.upcase(v)) | |
v_final = Enum.join(v, ", ") | |
v_final | |
end) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment