class RemiLib::Config::ResolverSet
- RemiLib::Config::ResolverSet
- Reference
- Object
Overview
The ResolverSet allows a collection of Resolver instances to be used in
a prioritized way.
Defined in:
remilib/config/resolverset.crConstructors
-
.new(*res : Resolver)
Creates a new
ResolverSetinstance.
Instance Method Summary
-
#<<(res : Resolver)
Appends a
Resolverto the end of this set. -
#[](idx : Int)
Returns the
Resolverat the given index. -
#dataFile(symname : Symbol) : Path
Given a symbolic name for a data file, this looks at each
Resolverin the order it appears in this set. -
#dataFile(symname : Symbol, &) : Nil
Given a symbolic name for a data file, this looks at each
Resolverin the order it appears in the set. -
#dataFile?(symname : Symbol) : Path | Nil
Given a symbolic name for a data file, this looks at each
Resolverin the order it appears in this set. -
#dataFile?(symname : Symbol, &) : Bool
Given a symbolic name for a data file, this looks at each
Resolverin the order it appears in the set. -
#defineDataFile(symname : Symbol, filename : String | Path)
Associates a data file named
filenamewith a symbolic name for every one of the associatedResolverinstances. -
#defineDataFile!(symname : Symbol, filename : String | Path)
Associates a data file named
filenamewith a symbolic name for every one of the associatedResolverinstances. -
#delete(res : Resolver) : Resolver | Nil
If the given
Resolverexists in this set, it is removed from this set and returned. -
#delete_at(idx : Int)
Deletes the given
Resolverfrom the given index. -
#each(&)
Loops over all of the
Resolverinstances in this set, yielding each one sequentially. -
#insert(idx : Int, res : Resolver)
Inserts the given
Resolverat the given index.
Constructor Detail
Instance Method Detail
Given a symbolic name for a data file, this looks at each Resolver in
the order it appears in this set. The first Resolver that knows about
the data file will return the Path associated with it.
If the symbol is not registered with any Resolvers in this set, then
this raises an UnknownDataFileError.
Given a symbolic name for a data file, this looks at each Resolver in
the order it appears in the set. The first Resolver that knows about
the data file will then open a new File stream and yield it. If the
symbol is not registered with any Resolver, then this raises an
UnknownDataFileError.
Given a symbolic name for a data file, this looks at each Resolver in
the order it appears in this set. The first Resolver that knows about
the data file will return the Path associated with it.
If the symbol is not registered with any Resolvers in this set, then
this returns nil.
Given a symbolic name for a data file, this looks at each Resolver in
the order it appears in the set. The first Resolver that knows about
the data file will then open a new File stream and yield it, then return
true. If the symbol is not registered with any Resolver, then this
returns false.
Associates a data file named filename with a symbolic name for every one
of the associated Resolver instances. The symbolic name must be unique
for every Resolver.
Associates a data file named filename with a symbolic name for every one
of the associated Resolver instances.
If the symbol is not unique to any of the Resolvers in this set, then
the old path is forgotten for that Resolver and the symbol becomes
associated with the new path.
If the given Resolver exists in this set, it is removed from this set
and returned. Otherwise, this returns nil.
Inserts the given Resolver at the given index.