Skip to content

Commit

Permalink
feat(Squarer): add module to return the square of a given number
Browse files Browse the repository at this point in the history
The Squarer module simply provides a square function that returns the
square result of the number provided.

The application has also had a supervisor added to enable basic running
of the program.
  • Loading branch information
Harvey Ball committed May 8, 2015
1 parent 7c548d7 commit 0791752
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
12 changes: 12 additions & 0 deletions lib/elixir_poolboy_example.ex
Original file line number Diff line number Diff line change
@@ -1,2 +1,14 @@
defmodule ElixirPoolboyExample do
use Application

def start(_type, _args) do
children = []

options = [
strategy: :one_for_one,
name: ElixirPoolboyExample.Supervisor
]

Supervisor.start_link(children, options)
end
end
5 changes: 5 additions & 0 deletions lib/elixir_poolboy_example/squarer.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
defmodule ElixirPoolboyExample.Squarer do
def square(x) do
x * x
end
end
5 changes: 4 additions & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ defmodule ElixirPoolboyExample.Mixfile do
#
# Type `mix help compile.app` for more information
def application do
[applications: [:logger]]
[
mod: {ElixirPoolboyExample, []},
applications: [:logger]
]
end

# Dependencies can be Hex packages:
Expand Down

0 comments on commit 0791752

Please sign in to comment.