Class: Indocker::ImageEvaluator

Inherits:
Object
  • Object
show all
Includes:
SmartIoC::Iocify
Defined in:
lib/indocker/image/image_evaluator.rb

Instance Method Summary collapse

Instance Method Details

#evaluate(context, &block) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/indocker/image/image_evaluator.rb', line 7

def evaluate(context, &block)
  image_dsl = Indocker::ImageDSL.new(context)
  
  image_dsl.instance_eval(&block)
  
  image_dsl.directives
    .map do |directive|
      next directive if !directive.partial?

      partial = .find_by_name(directive.name)
      evaluate(directive.context, &partial.definition)
    end
    .flatten
end