summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorPaul Schoenfelder <paulschoenfelder@gmail.com>2014-05-02 00:26:26 -0500
committerPaul Schoenfelder <paulschoenfelder@gmail.com>2014-05-02 00:26:26 -0500
commite4909d91379519645b906ef49e84450b0e771b95 (patch)
tree6bde3feb33e30bf67bf9274b8cd2719dd6c0687f /README.md
parentAdd missing hex initialization (diff)
Replace records with structs
Diffstat (limited to 'README.md')
-rw-r--r--README.md25
1 files changed, 13 insertions, 12 deletions
diff --git a/README.md b/README.md
index 4070a1d..3c61a05 100644
--- a/README.md
+++ b/README.md
@@ -26,7 +26,7 @@ Add ExIrc as a dependency to your project in mix.exs, and add it as an applicati
```elixir
defp deps do
- [{:exirc, github: "bitwalker/exirc"}]
+ [{:exirc, "~> 0.4.0"}]
end
defp application do
@@ -44,18 +44,19 @@ use ExIrc in practice. ExampleHandler here is the one that comes bundled with Ex
```elixir
defmodule ExampleSupervisor do
- defrecord State,
- host: "chat.freenode.net",
- port: 6667,
- pass: "",
- nick: "bitwalker",
- user: "bitwalker",
- name: "Paul Schoenfelder",
- client: nil,
- handlers: []
+ defmodule State do
+ defstruct host: "chat.freenode.net",
+ port: 6667,
+ pass: "",
+ nick: "bitwalker",
+ user: "bitwalker",
+ name: "Paul Schoenfelder",
+ client: nil,
+ handlers: []
+ end
def start_link(_) do
- :gen_server.start_link(__MODULE__, [State.new()])
+ :gen_server.start_link(__MODULE__, [%State{}])
end
def init(state) do
@@ -72,7 +73,7 @@ defmodule ExampleSupervisor do
ExIrc.Client.join client, "#elixir-lang"
ExIrc.Client.msg client, :privmsg, "#elixir-lang", "Hello world!"
- {:ok, state.client(client).handlers([handler])}
+ {:ok, %{state | :client => client, :handlers => [handler]}}
end
def terminate(_, state) do