class

Datapack::Store

Inherits Reference / Object

Constructors

Instance methods

[](key : Path)

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.

Source
[](key : String)
Source
[]=(key : Path, value)

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.

Source
[]=(key : String, value)
Source
find(key_fragment : Path)

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.

Source
find(key_fragment : String)
Source
find?(key_fragment : Path)

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.

Source
find?(key_fragment : String)
Source
find_all(key_fragment : Path)

Return all of the Resource values for all keys which match all of the elements of the key fragment.

Source
find_all(key_fragment : String)
Source
find_all_keys(key_fragment : Path)

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.

Source
find_all_keys(key_fragment : String)
Source
find_key(key_fragment : Path)

Find the first key which matches all of the elements of a key fragment. An exception will be raised if no key is found.

Source
find_key(key_fragment : String)
Source
find_key?(key_fragment : Path)

Find the first key which matches all of the elements of a key fragment. A nil will be returned if no key is found.

Source
find_key?(key_fragment : String)
Source
index
Source