mirror of
https://github.com/RevenueCat/purchases-ios
synced 2026-11-09 22:35:56 +05:45
24 lines
547 B
Swift
24 lines
547 B
Swift
//
|
|
// RootVarOperator.swift
|
|
//
|
|
// Created by Antonio Pallares.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
extension RulesEngine {
|
|
|
|
/// `rc.rootVar` — like `var`, but reads from the root data scope.
|
|
enum RootVarOperator {
|
|
|
|
static func opRootVar(args: Value, vars: Scope) throws -> Value {
|
|
try AccessorOperators.resolveVar(
|
|
args: args,
|
|
lookup: { AccessorOperators.lookupVar(in: vars.root, path: $0) },
|
|
vars: vars,
|
|
operatorName: "rc.rootVar"
|
|
)
|
|
}
|
|
}
|
|
}
|