Class: Prefab::Evaluation

Inherits:
Object
  • Object
show all
Defined in:
lib/prefab/evaluation.rb

Overview

Records the result of evaluating a config’s criteria and forensics for reporting

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config:, value:, value_index:, config_row_index:, context:, resolver:) ⇒ Evaluation

Returns a new instance of Evaluation.



8
9
10
11
12
13
14
15
# File 'lib/prefab/evaluation.rb', line 8

def initialize(config:, value:, value_index:, config_row_index:, context:, resolver:)
  @config = config
  @value = value
  @value_index = value_index
  @config_row_index = config_row_index
  @context = context
  @resolver = resolver
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



6
7
8
# File 'lib/prefab/evaluation.rb', line 6

def value
  @value
end

Instance Method Details

#report_and_return(evaluation_summary_aggregator) ⇒ Object



25
26
27
28
29
# File 'lib/prefab/evaluation.rb', line 25

def report_and_return(evaluation_summary_aggregator)
  report(evaluation_summary_aggregator)

  unwrapped_value
end

#reportable_valueObject



21
22
23
# File 'lib/prefab/evaluation.rb', line 21

def reportable_value
  deepest_value.reportable_value
end

#unwrapped_valueObject



17
18
19
# File 'lib/prefab/evaluation.rb', line 17

def unwrapped_value
  deepest_value.unwrap
end