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.



312
313
314
315
316
317
# File 'lib/jac/configuration.rb', line 312

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



367
368
369
370
371
# File 'lib/jac/configuration.rb', line 367

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

Instance Method Details

#cObject Also known as: config, conf, cfg



324
325
326
# File 'lib/jac/configuration.rb', line 324

def c
  @context
end

#evaluate(key) ⇒ Object



319
320
321
322
# File 'lib/jac/configuration.rb', line 319

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