class

UtilFile

Inherits YAML::Serializable < Reference < Object

This class provides functionality for storing data in utility files, such as config and data.

Constructors

new(ctx : YAML::ParseContext, node : YAML::Nodes::Node)
Source
new(*, __context_for_yaml_serializable ctx : YAML::ParseContext, __node_for_yaml_serializable node : YAML::Nodes::Node)
Source

Class methods

load(dir_name, file_name)

Attempts to read the yml from disk at the specified filepath. If there is no file there, nothing will be read, and the defaults (which should be implemented in classes extending UtilFile) will not be changed.

Source

Instance methods

dir_name
Source
dir_name=(dir_name : String | Nil)
Source
file_name
Source
file_name=(file_name : String | Nil)
Source
filepath

Returns the filepath, which is just a concatenation of the directory and filename.

Source
save

Serializes the UtilFile and writes it out to the specified filepath. If the directory specified does not exist, it will be created before writing. Similarly, the file will be created if it doesn't exist.

Source