Current section

2 Versions

Jump to

Compare versions

6 files changed
+13 additions
-8 deletions
  @@ -17,4 +17,4 @@
17 17 {<<"name">>,<<"exirc">>},
18 18 {<<"optional">>,false},
19 19 {<<"requirement">>,<<"~> 1.0">>}]]}.
20 - {<<"version">>,<<"0.1.0">>}.
20 + {<<"version">>,<<"0.1.1">>}.
  @@ -9,6 +9,7 @@ defmodule Kuma.Bot do
9 9
10 10 ### Client API
11 11
12 + @doc false
12 13 def start_link(client) do
13 14 GenServer.start_link(__MODULE__, client, name: __MODULE__)
14 15 end
  @@ -30,14 +31,10 @@ defmodule Kuma.Bot do
30 31
31 32 ### GenServer API
32 33
33 - @doc """
34 - GenServer.init/1 callback
35 - """
34 + @doc false
36 35 def init(client), do: {:ok, client}
37 36
38 - @doc """
39 - GenServer.handle_cast/2 callback
40 - """
37 + @doc false
41 38 def handle_cast({:msg, message, recipient}, client) do
42 39 Client.msg client, :privmsg, recipient, message
43 40 {:noreply, client}
  @@ -10,6 +10,9 @@ defmodule Kuma.Conn do
10 10 channels: []
11 11 ]
12 12
13 + @doc """
14 + Build a Conn struct from a map of params.
15 + """
13 16 def from_params(params) when is_map(params) do
14 17 Enum.reduce(params, %__MODULE__{}, fn {k, v}, acc ->
15 18 case Map.has_key?(acc, k) do
  @@ -3,6 +3,7 @@ defmodule Kuma.Handler do
3 3 do_use()
4 4 end
5 5
6 + @doc false
6 7 def do_use() do
7 8 quote do
8 9 use GenServer
  @@ -13,10 +14,12 @@ defmodule Kuma.Handler do
13 14 alias ExIrc.SenderInfo
14 15 alias Kuma.Bot
15 16
17 + @doc false
16 18 def start_link(conn) do
17 19 GenServer.start_link(__MODULE__, [conn])
18 20 end
19 21
22 + @doc false
20 23 def init([conn]) do
21 24 Client.add_handler conn.client, self()
22 25 {:ok, conn}
  @@ -5,10 +5,12 @@ defmodule Kuma.LoginHandler do
5 5
6 6 alias ExIrc.Client
7 7
8 + @doc false
8 9 def start_link(conn) do
9 10 GenServer.start_link(__MODULE__, [conn])
10 11 end
11 12
13 + @doc false
12 14 def init([conn]) do
13 15 Client.add_handler conn.client, self()
14 16 {:ok, conn}
Loading more files…