Skip to content

Commit

Permalink
Merge pull request #5 from tsloughter/master
Browse files Browse the repository at this point in the history
support atom values
  • Loading branch information
soranoba committed May 8, 2015
2 parents e218855 + 9413416 commit 5a15c03
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/mustache.erl
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,13 @@ remove_space_from_tail_impl(_, Size) ->
Size.

%% @doc Number to binary
-spec to_binary(number() | binary() | string()) -> binary() | string().
-spec to_binary(number() | binary() | string() | atom()) -> binary() | string().
to_binary(Integer) when is_integer(Integer) ->
list_to_binary(integer_to_list(Integer));
to_binary(Float) when is_float(Float) ->
io_lib:format("~p", [Float]);
to_binary(Atom) when is_atom(Atom) ->
list_to_binary(atom_to_list(Atom));
to_binary(X) ->
X.

Expand Down

0 comments on commit 5a15c03

Please sign in to comment.