Files
geef/lib/geef/pkt.ex
Carlos Martín Nieto 808646a5ca Work towards elixir 14
While here, make the object be an elixir struct instead of delegating to
the erlang code.

As part of this, geef_nif:commit_tree() has been fixed to return the id,
insted of the type, as we know it's going to be a tree, but not then id.
2014-08-03 01:03:17 +02:00

22 lines
402 B
Elixir

require Record
defmodule Geef.Request do
defstruct Record.extract(:geef_request, from: "src/geef_records.hrl")
end
defmodule Geef.Pkt do
def parse_request(str) do
case :geef_pkt.parse_request(str) do
{:ok, req} ->
{:ok, Geef.Request.new req}
error ->
error
end
end
def parse(str), do: :geef_pkt.parse(str)
def line(str), do: :geef_pkt.line(str)
end