class Strategize::PolicyEvaluation

Provides information on a single policy evaluation. This includes the policy that was evaluated and the evaluation digest for the rules defined on the policy.

Attributes

policy[R]
rule_digest[R]

Public Class Methods

new(policy, rule_digest) click to toggle source

Create a new PolicyEvaluation

@param policy [Policy] @param rule_result_collection [RuleEvaluationDigest] @return [PolicyResult]

# File lib/strategize/policies/policy_evaluation.rb, line 14
def initialize(policy, rule_digest)
  @policy = policy
  @rule_digest = rule_digest
end

Public Instance Methods

result() click to toggle source

Determine if all the rules defined on the policy evaluated to true.

@return [Boolean]

# File lib/strategize/policies/policy_evaluation.rb, line 22
def result
  @rule_digest.result
end