adobe / aepsdk-rulesengine-ios

@@ -12,13 +12,12 @@
Loading
12 12
13 13
import Foundation
14 14
15 -
@dynamicCallable
16 15
public enum Operand<T> {
17 16
    case none
18 17
    case some(T)
19 18
    case token(MustacheToken)
20 19
21 -
    func dynamicallyCall(withArguments args: [Context]) -> T? {
20 +
    func resolve(in context: Context) -> T? {
22 21
        switch self {
23 22
        case .none:
24 23
            return nil
@@ -26,7 +25,7 @@
Loading
26 25
            return value
27 26
        case let .token(token):
28 27
29 -
            if let result = token.resolve(in: args[0].transformer, data: args[0].data) {
28 +
            if let result = token.resolve(in: context.transformer, data: context.data) {
30 29
                return result as? T
31 30
            }
32 31
            return nil

@@ -28,8 +28,8 @@
Loading
28 28
29 29
    public func evaluate(in context: Context) -> Result<Bool, RulesFailure> {
30 30
        Log.trace(label: LOG_TAG, "Evaluating \(lhs) - \(operationName) - \(rhs)")
31 -
        let resolvedLhs = lhs(context)
32 -
        let resolvedRhs = rhs(context)
31 +
        let resolvedLhs = lhs.resolve(in: context)
32 +
        let resolvedRhs = rhs.resolve(in: context)
33 33
        var result: Result<Bool, RulesFailure>
34 34
        if let resolvedLhs_ = resolvedLhs, let resolvedRhs_ = resolvedRhs {
35 35
            result = context.evaluator.evaluate(operation: operationName, lhs: resolvedLhs_, rhs: resolvedRhs_)

@@ -24,7 +24,7 @@
Loading
24 24
25 25
    public func evaluate(in context: Context) -> Result<Bool, RulesFailure> {
26 26
        Log.trace(label: LOG_TAG, "Evaluating \(operationName) - \(lhs)")
27 -
        let resolvedLhs = lhs(context)
27 +
        let resolvedLhs = lhs.resolve(in: context)
28 28
        if let resolvedLhs_ = resolvedLhs {
29 29
            return context.evaluator.evaluate(operation: operationName, lhs: resolvedLhs_)
30 30
        }
Files Coverage
Sources/AEPRulesEngine 95.85%
Project Totals (17 files) 95.85%
1
codecov:
2
  notify:
3
    require_ci_to_pass: yes
4

5
coverage:
6
  precision: 2
7
  round: nearest
8
  range: "70...90"
9

10
  status:
11
    project: yes
12
    patch: yes
13
    changes: no
14

15
  ignore:
16
    - "./Tests/.*"
17

18
parsers:
19
  gcov:
20
    branch_detection:
21
      conditional: yes
22
      loop: yes
23
      method: no
24
      macro: no
25

26
comment:
27
  layout: "header, diff"
28
  behavior: default
29
  require_changes: no
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading