Skip to content

Instantly share code, notes, and snippets.

@samjarman
Last active May 9, 2016 22:58
Show Gist options
  • Save samjarman/ccf4561bedc0b2d8860c3ff50c3d97f5 to your computer and use it in GitHub Desktop.
Save samjarman/ccf4561bedc0b2d8860c3ff50c3d97f5 to your computer and use it in GitHub Desktop.
Showing a Elixir Module and Method with a Doctest
defmodule Misc do
@moduledoc """
This contains some functions for learning Elixir.
"""
@doc """
This multiplies two values.
Examples:
iex> Misc.multiply(3,4)
12
iex> Misc.multiply(-3,4)
-12
"""
def multiply(x, y) do
x * y
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment