VariableProtocol

internal protocol VariableProtocol

Protocol for all Variables

  • Unique identifier of the variable that is used when matching and returning them in the matcher.

    Declaration

    Swift

    var name: String { get }
  • Options that modify the behaviour of the variable matching, and the output that the framework provides

    Declaration

    Swift

    var options: VariableOptions { get }
  • The result of the evaluated variable will be ran through this map function, transforming its value. By default the map tries to convert the matched value to the expected type, using the as? operator.

    Declaration

    Swift

    func performMap(input: Any, interpreter: Any) -> Any?

    Parameters

    input

    The first parameter is the value is going to be transformed

    interpreter

    Helps the mapper function to parse and interpret the contents

    Return Value

    The transformed value or nil - if the value was validated with a negative result