Skip to content

Instantly share code, notes, and snippets.

@ScottRadcliff
Last active April 20, 2019 15:54

Revisions

  1. ScottRadcliff revised this gist Apr 20, 2019. 1 changed file with 14 additions and 1 deletion.
    15 changes: 14 additions & 1 deletion signature.exs
    Original file line number Diff line number Diff line change
    @@ -2,4 +2,17 @@ defmodule Sample.Signature do
    def match(1), do: IO.puts "Matched 1"
    def match(2), do: IO.puts "Matched 2"
    def match(number), do: IO.puts "Matched #{number} dynamically"
    end
    end

    # iex "signature.exs"
    # Sample.Signature.match(1)
    # Matched 1
    # :ok
    #
    # Sample.Signature.match(2)
    # Matched 2
    # :ok
    #
    # Sample.Signature.match(22)
    # Matched 22 dynamically
    # :ok
  2. ScottRadcliff created this gist Apr 20, 2019.
    5 changes: 5 additions & 0 deletions signature.exs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    defmodule Sample.Signature do
    def match(1), do: IO.puts "Matched 1"
    def match(2), do: IO.puts "Matched 2"
    def match(number), do: IO.puts "Matched #{number} dynamically"
    end