core: Inspect protocol implementation for RDF.BlankNode

This commit is contained in:
Marcel Otto 2017-05-19 17:23:54 +02:00
parent 34f6a0e28b
commit 229f42ee3c

View file

@ -37,6 +37,12 @@ defmodule RDF.InspectHelper do
end
end
defimpl Inspect, for: RDF.BlankNode do
def inspect(%RDF.BlankNode{id: id}, _opts) do
"~B<#{id}>"
end
end
defimpl Inspect, for: RDF.Literal do
def inspect(%RDF.Literal{value: value, language: language}, _opts) when not is_nil(language) do
~s[~L"#{value}"#{language}]