class Datapack::Store
- Datapack::Store
- Reference
- Object
Defined in:
datapack.crConstructors
Instance Method Summary
-
#[](key : Path)
Get a value indexed by the given path in the datapack.
- #[](key : String)
-
#[]=(key : Path, value)
Set a value within the the datapack.
- #[]=(key : String, value)
-
#find(key_fragment : Path)
Return the
Resource
value for the first key which matches all of the elements of the key fragment. - #find(key_fragment : String)
-
#find?(key_fragment : Path)
Return the
Resource
value for the first key which matches all of the elements of the key fragment. - #find?(key_fragment : String)
-
#find_all(key_fragment : Path)
Return all of the
Resource
values for all keys which match all of the elements of the key fragment. - #find_all(key_fragment : String)
-
#find_all_keys(key_fragment : Path)
Find and return an array of all keys which match the key fragment provided as an argument.
- #find_all_keys(key_fragment : String)
-
#find_key(key_fragment : Path)
Find the first key which matches all of the elements of a key fragment.
- #find_key(key_fragment : String)
-
#find_key?(key_fragment : Path)
Find the first key which matches all of the elements of a key fragment.
- #find_key?(key_fragment : String)
- #index : SplayTreeMap(String, SplayTreeMap(String, Array(Path)))
Constructor Detail
Instance Method Detail
Get a value indexed by the given path in the datapack. If the path is prefixed with a namespace:
namespace:/path/to/file.txt
The path will be searched for within that namespace. Otherwise, it will be searched
for within the default
namespace.
Set a value within the the datapack. As with getting a value, the path can be prefixed
with a namespace, and if no namespace is provided, default
will be used. The value to be
stored must be an instance of Resource
.
Return the Resource
value for the first key which matches all of the elements of the
key fragment. An exception will be raised if no key is found.
Return the Resource
value for the first key which matches all of the elements of the
key fragment. A nil
will be returned if no key is found.
Return all of the Resource
values for all keys which match all of the elements of the
key fragment.
Find and return an array of all keys which match the key fragment provided as an argument. A key fragment is expressed as a path. Each of the elements of the path will be matched against an index of fragments, and all keys which contain all elements of the key fragment will be returned.
Find the first key which matches all of the elements of a key fragment. An exception will be raised if no key is found.
Find the first key which matches all of the elements of a key fragment.
A nil
will be returned if no key is found.