Created
January 26, 2016 14:12
-
-
Save sstrigler/34f72edb8d1134e9de5c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(foo_handler). | |
-callback handle_message(binary(), map()) -> | |
ok | {ok, term()} | {error, term()}. | |
-export([validate_and_handle/2]). | |
-spec validate_and_handle(atom(), binary()) -> | |
ok | {ok, term()} | {error, term()}. | |
validate_and_handle(Module, Message) -> | |
case foo:validate(Message) of | |
{ok, Data} -> | |
Module:handle_message(Data); | |
Error -> | |
Error | |
end. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
elvis would complain with
src/foo_handler.erl [FAIL]