Created
February 8, 2017 17:13
-
-
Save joshleecreates/139066ecbbc2f4a9660f874827436711 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 process_url(url) do | |
defaults = %{ | |
thing: "thing1value" | |
} | |
uri = URI.parse(url) | |
params = URI.decode_query(uri.query, defaults) |> URI.encode_query | |
URI.merge(@base_url, uri.path <> "?" <> params) |> to_string | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@joshleecreates it is preferred to start pipes with a bare value, see: https://github.com/christopheradams/elixir_style_guide#bare-variables
Couple different takes on this: