class CNFInstall::Config::ConfigUpdater
- CNFInstall::Config::ConfigUpdater
- Reference
- Object
Defined in:
tasks/utils/cnf_installation/config_updater/config_updater.crConstant Summary
-
VERSION_PARSERS =
{ConfigVersion::V1 => ->(raw_input_config : String) do ConfigV1.from_yaml(raw_input_config) end}
-
Define parsing rules at the top of the class REQUIRES FUTURE EXTENSION in case of new config format.
-
VERSION_TRANSFORMATIONS =
{ConfigVersion::V1 => ->(input_config : ConfigBase) do (V1ToV2Transformation.new(input_config.as(ConfigV1))).transform end}
-
This approach could be extended in future by making use of abstract classes, which would remove the need for hashes. Define transformation rules at the top of the class REQUIRES FUTURE EXTENSION in case of new config format.
Constructors
Instance Method Summary
-
#serialize_to_file(file_path : String) : String
Serialize the updated config to a file and return the file path.
-
#serialize_to_string : String
Serialize the updated config to a string.
-
#transform
Performs the transformation from Vx to Vy.
Constructor Detail
Instance Method Detail
def serialize_to_file(file_path : String) : String
#
Serialize the updated config to a file and return the file path.