From 528d0ebffd11c8c07259e0e764f3381a12d82418 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Tue, 26 Jul 2011 13:58:48 +0200 Subject: Small cosmetic changes and doc update to the cookie patch --- src/cowboy_cookies.erl | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'src/cowboy_cookies.erl') diff --git a/src/cowboy_cookies.erl b/src/cowboy_cookies.erl index 8a11b19..3a50ba6 100644 --- a/src/cowboy_cookies.erl +++ b/src/cowboy_cookies.erl @@ -17,8 +17,7 @@ -module(cowboy_cookies). -%% API. --export([parse_cookie/1, cookie/3, cookie/2]). +-export([parse_cookie/1, cookie/3, cookie/2]). %% API. %% Types. -type kv() :: {Name::binary(), Value::binary()}. @@ -33,10 +32,7 @@ -include_lib("eunit/include/eunit.hrl"). - -%% ---------------------------------------------------------------------------- -%% API -%% ---------------------------------------------------------------------------- +%% API. %% @doc Parse the contents of a Cookie header field, ignoring cookie %% attributes, and return a simple property list. @@ -110,10 +106,7 @@ cookie(Key, Value, Options) when is_binary(Key) andalso is_binary(Value) andalso CookieParts = <>, {<<"Set-Cookie">>, CookieParts}. - -%% ---------------------------------------------------------------------------- -%% Private -%% ---------------------------------------------------------------------------- +%% Internal. %% @doc Check if a character is a white space character. -spec is_whitespace(char()) -> boolean(). @@ -231,7 +224,6 @@ read_quoted(<<$\\, Any, Rest/binary>>, Acc) -> read_quoted(<>, Acc) -> read_quoted(Rest, <>). - %% @doc Drop characters while a function returns true. -spec binary_dropwhile(fun((char()) -> boolean()), binary()) -> binary(). binary_dropwhile(_F, <<"">>) -> @@ -294,9 +286,7 @@ any_to_binary(V) when is_atom(V) -> any_to_binary(V) when is_integer(V) -> list_to_binary(integer_to_list(V)). -%% ---------------------------------------------------------------------------- -%% Tests -%% ---------------------------------------------------------------------------- +%% Tests. -ifdef(TEST). -- cgit v1.2.3