summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/struct/direction.erl')
-rw-r--r--src/struct/direction.erl23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/struct/direction.erl b/src/struct/direction.erl
index 074cadf..84ae272 100644
--- a/src/struct/direction.erl
+++ b/src/struct/direction.erl
@@ -12,8 +12,8 @@
-export
(
[
- from_binary/1,
- to_binary/1
+ decode/1,
+ encode/1
]
).
@@ -24,13 +24,14 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% EXPORTED FUNCTIONS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
--spec from_binary (binary()) -> enum().
-from_binary (<<"U">>) -> up;
-from_binary (<<"D">>) -> down;
-from_binary (<<"L">>) -> left;
-from_binary (<<"R">>) -> right.
+-spec decode (binary()) -> enum().
+decode (<<"U">>) -> up;
+decode (<<"D">>) -> down;
+decode (<<"L">>) -> left;
+decode (<<"R">>) -> right.
-to_binary (up) -> <<"U">>;
-to_binary (down) -> <<"D">>;
-to_binary (left) -> <<"L">>;
-to_binary (right) -> <<"R">>.
+-spec encode (enum()) -> binary().
+encode (up) -> <<"U">>;
+encode (down) -> <<"D">>;
+encode (left) -> <<"L">>;
+encode (right) -> <<"R">>.