Created
October 25, 2015 21:03
-
-
Save leandrocp/1f8c5802fa945feef2c4 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
defmodule Greeting do | |
def say(%{hello: name}) do | |
IO.puts "Hello #{name}" | |
end | |
def say(%{ola: name}) do | |
IO.puts "Olá #{name}" | |
end | |
end | |
Greeting.say(%{hello: "john"}) | |
Greeting.say(%{ola: "joao"}) | |
# ❯ elixir greeting.exs | |
# Hello john | |
# Olá joao |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment