Make the RDF.Resource.Generator runtime-configurable
This commit is contained in:
parent
424909b1f9
commit
663b7b6ea9
1 changed files with 6 additions and 4 deletions
|
@ -4,9 +4,11 @@ defmodule RDF.Resource do
|
||||||
|
|
||||||
@type t :: IRI.t() | BlankNode.t()
|
@type t :: IRI.t() | BlankNode.t()
|
||||||
|
|
||||||
@default_generator (Application.get_env(:rdf, :resource) || [generator: BlankNode])
|
def generator do
|
||||||
|> Generator.config()
|
Application.get_env(:rdf, :resource, generator: BlankNode)
|
||||||
|
|> Generator.config()
|
||||||
|
end
|
||||||
|
|
||||||
def new(), do: Generator.generate(@default_generator, nil)
|
def new(), do: generator() |> Generator.generate(nil)
|
||||||
def new(args), do: Generator.generate(@default_generator, args)
|
def new(args), do: generator() |> Generator.generate(args)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue