RSDComparableSurveyRule
public protocol RSDComparableSurveyRule : RSDSurveyRule, RSDComparable
RSDComparableSurveyRule 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
skipToIdentifierwill be assumed to beRSDIdentifier.exitDeclaration
Swift
var skipToIdentifier: String? -
The rule operator to apply. If
nil,.equalwill be assumed unless theexpectedAnsweris also nil, in which case.skipwill be assumed.Declaration
Swift
var ruleOperator: RSDSurveyRuleOperator?
-
evaluateRule(with:)Extension methodFor a given result (if any), what is the step that the survey should go to next?
For the
RSDComparableSurveyRule, this will evaluate the result using theruleOperatorand thematchingAnswerand return theskipIdentifierif the rule evaluates totrue.Declaration
Swift
public func evaluateRule(with result: RSDResult?) -> String?Parameters
resultsThe result to evaluate.
Return Value
The identifier to skip to if the result evaluates to
true.
View on GitHub
RSDComparableSurveyRule Protocol Reference