Initial signature test

This commit is contained in:
Carlos Martín Nieto
2013-06-11 16:34:02 +02:00
parent f8f791296a
commit 9d222df593
8 changed files with 127 additions and 0 deletions

9
lib/geef/signature.ex Normal file
View File

@@ -0,0 +1,9 @@
defrecord Geef.Signature, Record.extract(:geef_signature, from: "src/geef_records.hrl") do
def new(name, email), do: :geef_sig.new(name, email) |> maybe_sig
def new(name, email, time), do: :geef_sig.new(name, email, time) |> maybe_sig
defp maybe_sig({ok, sig}), do: {ok, Geef.Signature.new sig}
defp maybe_sig(error), do: error
end