class Novika::Resolver::Session
- Novika::Resolver::Session
- Reference
- Object
Overview
A resolver session interacts with a RunnableRoot
in a way that
allows you to query. Querying is done by #push
ing some queries,
and then #pop
ping them "into" a Response
object which you should
create beforehand, and which you own.
session = Resolver::Session.new(root)
session.push("foo")
session.push("bar")
session.push("baz")
response1 = Resolver::Response.new
session.pop(response1)
# Re-use the same session. Queries were popped, so the session
# is clean.
session.push("xyzzy")
session.push("byzzy")
response2 = Resolver::Response.new
session.pop(response2)
# Run the accepted stuff from the responses...
response1.accepted_set.each_designation(root, &.run)
response2.accepted_set.each_designation(root, &.run)
Defined in:
novika/resolver.crConstructors
Instance Method Summary
-
#each_explicit(& : RunnableQuery -> )
Yields only those queries from the query list that were marked as explicit.
-
#each_query(& : RunnableQuery -> )
Yields all queries from the query list.
-
#on_container_rewritten(&callback : RunnableContainer -> )
Registers callback to be called when a runnable container is thoroughly rewritten.
-
#on_container_rewritten(callback : RunnableContainer -> )
Registers callback to be called when a runnable container is thoroughly rewritten.
-
#pop(response : Response) : ResolutionSet
Resolves the list of queries that were
#push
ed, returns the single resolution set comprised of resolutions for those queries that were accepted by the resolver. -
#push(query : RunnableQuery, explicit = false)
Appends query to the list of queries to be resolved during this session; allows to mark it as explicit ("hand-written") if necessary.
-
#push(query : Query, explicit = false)
Appends query to the list of queries to be resolved during this session; allows to mark it as explicit ("hand-written") if necessary.
-
#push(queries : Array(RunnableQuery), explicit = false)
Appends the entire array of queries to the list of queries to be resolved during this session; allows to mark all of them as explicit ("hand-written") if necessary.
-
#push(queries : Array(Query) | Array(String) | Array(Path), explicit = false)
Appends the entire array of queries to the list of queries to be resolved during this session; allows to mark all of them as explicit ("hand-written") if necessary.
Constructor Detail
Instance Method Detail
Yields only those queries from the query list that were marked as explicit.
Registers callback to be called when a runnable container is thoroughly rewritten.
Registers callback to be called when a runnable container is thoroughly rewritten.
Resolves the list of queries that were #push
ed, returns the single
resolution set comprised of resolutions for those queries that
were accepted by the resolver.
Also fills response, see Response
for what you can get out of it.
Appends query to the list of queries to be resolved during this session; allows to mark it as explicit ("hand-written") if necessary.
Appends query to the list of queries to be resolved during this session; allows to mark it as explicit ("hand-written") if necessary.
Appends the entire array of queries to the list of queries to be resolved during this session; allows to mark all of them as explicit ("hand-written") if necessary.