Exjpet (exjpet v0.3.0)
Documentation for Exjpet.
Examples
with (default) Poison decoder / encoder ...
iex> epm = Exjpet.compile("[1, *, (?<cap>{})]")
iex> json = Exjpet.decode(~s([1, 2, {"a": 42}]), :poison)
iex> Exjpet.run(json, epm)
{true, %{"cap" => [%{"a" => 42}]}}... or with Jason as decoder / encoder
iex> epm = Exjpet.compile("[1, *, (?<cap>{})]", :jason)
iex> json = Exjpet.decode(~s([1, 2, {"a": 42}]), :jason)
iex> Exjpet.run(json, epm)
{true, %{"cap" => [%{"a" => 42}]}}
Link to this section Summary
Functions
See :ejpet.backend/1.
Compile expr with Poison as JSON codec.
See :ejpet.compile/2.
See :ejpet.compile/3.
See :ejpet.compile/4.
Decode string str using Poison.
See :ejpet.decode/2.
See :ejpet.empty_capture_set/0.
See :ejpet.empty_capture_set/1.
Encode JSON document json using Poison.
See :ejpet.encode/2.
See :ejpet.generator/1.
See :ejpet.get_capture/2.
See :ejpet.get_capture/3.
See :ejpet.get_captures/1.
See :ejpet.get_status/1.
See :ejpet.match/2.
See :ejpet.match/3.
See :ejpet.match/4.
See :ejpet.run/2.
See :ejpet.run/3.
Link to this section Functions
backend(arg1)
See :ejpet.backend/1.
compile(expr)
Compile expr with Poison as JSON codec.
Same as Exjpet.compile(expr, :poison)
iex> epm = Exjpet.compile "[*]"
iex> Exjpet.backend epm
:poison
compile(arg1, arg2)
See :ejpet.compile/2.
compile(arg1, arg2, arg3)
See :ejpet.compile/3.
compile(arg1, arg2, arg3, arg4)
See :ejpet.compile/4.
decode(str)
Decode string str using Poison.
Same as Exjpet.decode(str, :poison)
iex> Exjpet.decode ~s({"foo": 42})
%{"foo" => 42}
decode(arg1, arg2)
See :ejpet.decode/2.
empty_capture_set()
See :ejpet.empty_capture_set/0.
empty_capture_set(arg1)
See :ejpet.empty_capture_set/1.
encode(json)
Encode JSON document json using Poison.
Same as Exjpet.encode(json, :poison)
iex> Exjpet.encode %{foo: 42}
"{\"foo\":42}"
encode(arg1, arg2)
See :ejpet.encode/2.
generator(arg1)
See :ejpet.generator/1.
get_capture(arg1, arg2)
See :ejpet.get_capture/2.
get_capture(arg1, arg2, arg3)
See :ejpet.get_capture/3.
get_captures(arg1)
See :ejpet.get_captures/1.
get_status(arg1)
See :ejpet.get_status/1.
match(arg1, arg2)
See :ejpet.match/2.
match(arg1, arg2, arg3)
See :ejpet.match/3.
match(arg1, arg2, arg3, arg4)
See :ejpet.match/4.
run(arg1, arg2)
See :ejpet.run/2.
run(arg1, arg2, arg3)
See :ejpet.run/3.