Download:
child 38:ec8d1ad0da1d
parent 36:4d40c4b8e8b0
37:674e9537b6ab
Anton Shestakov <engored@ya.ru>, Mon, 03 Mar 2014 20:06:02 +0900
Move #state record definition to rps_rules.hrl.

3 файлов изменено, 3 вставок(+), 4 удалений(-) [+]
src/rps3.erl file | annotate | diff | comparison | revisions
src/rps_rules.erl file | annotate | diff | comparison | revisions
src/rps_rules.hrl file | annotate | diff | comparison | revisions
--- a/src/rps3.erl Mon Mar 03 20:00:26 2014 +0900
+++ b/src/rps3.erl Mon Mar 03 20:06:02 2014 +0900
@@ -2,8 +2,7 @@
-behaviour(gen_server).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
-export([start_link/0, get_hands/0, winning_hand/1, why/2]).
-
--record(state, {hands=[], beats=dict:new(), loses=dict:new(), why=dict:new()}).
+-include("rps_rules.hrl").
start_link() ->
gen_server:start_link({local, ?MODULE}, ?MODULE, [], []).
--- a/src/rps_rules.erl Mon Mar 03 20:00:26 2014 +0900
+++ b/src/rps_rules.erl Mon Mar 03 20:06:02 2014 +0900
@@ -1,7 +1,6 @@
-module(rps_rules).
-export([parse/1, winning_hand/2]).
-
--record(state, {hands=[], beats=dict:new(), loses=dict:new(), why=dict:new()}).
+-include("rps_rules.hrl").
parse(Text) ->
Tokens = lists:map(fun list_to_atom/1, string:tokens(Text, " ")),
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/rps_rules.hrl Mon Mar 03 20:06:02 2014 +0900
@@ -0,0 +1,1 @@
+-record(state, {hands=[], beats=dict:new(), loses=dict:new(), why=dict:new()}).