class Proforma::Modeling::Collection
A general purpose grouping of modeling objects. When compiled, they will each be compiled once then their output(s) are combined and flattened.
Attributes
children[W]
Public Class Methods
new(children: [])
click to toggle source
# File lib/proforma/modeling/collection.rb, line 19 def initialize(children: []) @children = ModelFactory.array(children) end
Public Instance Methods
children()
click to toggle source
# File lib/proforma/modeling/collection.rb, line 23 def children Array(@children) end
compile(data, evaluator)
click to toggle source
# File lib/proforma/modeling/collection.rb, line 27 def compile(data, evaluator) children.map do |section| section.respond_to?(:compile) ? section.compile(data, evaluator) : section end.flatten end