AcceptableByConfigurationElement

public protocol AcceptableByConfigurationElement

Type of an object that can be used as a configuration element.

  • Initializer taking a value from a configuration to create an element of Self.

    Declaration

    Swift

    init(fromAny value: Any, context ruleID: String) throws

    Parameters

    value

    Value from a configuration.

    ruleID

    The rule’s identifier in which context the configuration parsing runs.

  • Make the object an option.

    Declaration

    Swift

    func asOption() -> OptionType

    Return Value

    Option representing the object.

  • asDescription(with:) Default implementation

    Make the object a description.

    Default Implementation

    Declaration

    Swift

    func asDescription(with key: String) -> RuleConfigurationDescription

    Parameters

    key

    Name of the option to be put into the description.

    Return Value

    Configuration description of this object.

  • apply(_:ruleID:) Default implementation

    Update the object.

    Default Implementation

    Declaration

    Swift

    mutating func apply(_ value: Any, ruleID: String) throws

    Parameters

    value

    New underlying data for the object.

    ruleID

    The rule’s identifier in which context the configuration parsing runs.