RSDComparableSurveyRuleObject

public struct RSDComparableSurveyRuleObject<T : Codable> : RSDComparableSurveyRule, Codable

RSDComparableSurveyRuleObject is a survey rule that matches an expected result to the answer and vends a skip identifier if the match is evaluated to true.

  • Optional skip identifier for this rule. If available, this will be used as the skip identifier, otherwise the skipToIdentifier will be assumed to be RSDIdentifier.exit

    Declaration

    Swift

    public let skipToIdentifier: String?
  • The rule operator to apply. If nil, .equal will be assumed unless the expectedAnswer is also nil, in which case .skip will be assumed.

    Declaration

    Swift

    public let ruleOperator: RSDSurveyRuleOperator?
  • Expected answer for the rule. If nil, then the operator must be .skip or this will return a nil value.

    Declaration

    Swift

    public var matchingAnswer: Any?
  • Undocumented

    Declaration

    Swift

    public let matchingValue: Value?
  • Default initializer.

    Declaration

    Swift

    public init(skipToIdentifier: String?, matchingValue: Value?, ruleOperator: RSDSurveyRuleOperator?)

    Parameters

    skipToIdentifier

    Skip identifier for this rule.

    matchingValue

    Value-typed matching answer.

    ruleOperator

    The rule operator to apply.

  • Initialize from a Decoder. This method will decode the values and also check that the combination of inputs is valid.

    Throws

    DecodingError if there is a decoding error.

    Declaration

    Swift

    public init(from decoder: Decoder) throws

    Parameters

    decoder

    The decoder to use to decode this instance.