Class: Jac::Configuration::ConfigurationEvaluator

Inherits:
Object
  • Object
show all
Defined in:
lib/jac/configuration.rb

Overview

Evaluates all strings inside resolved profile object

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(src_object, dst_object) ⇒ ConfigurationEvaluator

Returns a new instance of ConfigurationEvaluator.



347
348
349
350
351
352
# File 'lib/jac/configuration.rb', line 347

def initialize(src_object, dst_object)
  @object = src_object
  @evaluated = dst_object
  @context = EvaluationContext.new(self)
  resolve_object
end

Class Method Details

.evaluate(o) ⇒ Object



402
403
404
405
406
# File 'lib/jac/configuration.rb', line 402

def evaluate(o)
  dst = {}
  ConfigurationEvaluator.new(o, dst)
  dst
end

Instance Method Details

#cObject Also known as: config, conf, cfg



359
360
361
# File 'lib/jac/configuration.rb', line 359

def c
  @context
end

#evaluate(key) ⇒ Object



354
355
356
357
# File 'lib/jac/configuration.rb', line 354

def evaluate(key)
  return @evaluated[key] if @evaluated.key? key
  @evaluated[key] = evaluate_deep(@object[key])
end