Class: ConfigTemplates::Models::Compilation
- Inherits:
-
Object
- Object
- ConfigTemplates::Models::Compilation
- Defined in:
- lib/config_templates/models/compilation.rb
Instance Method Summary collapse
-
#initialize(outputs) ⇒ Compilation
constructor
A new instance of Compilation.
- #reject(expression) ⇒ Object
- #select(expression) ⇒ Object
- #send_to(output_name) ⇒ Object
Constructor Details
#initialize(outputs) ⇒ Compilation
Returns a new instance of Compilation.
5 6 7 8 |
# File 'lib/config_templates/models/compilation.rb', line 5 def initialize(outputs) @outputs = outputs @context = ::ConfigTemplates::Contexts::Compilation.new end |
Instance Method Details
#reject(expression) ⇒ Object
15 16 17 18 |
# File 'lib/config_templates/models/compilation.rb', line 15 def reject(expression) @context.criteria ::ConfigTemplates::Criteria::Name.new expression, false self end |
#select(expression) ⇒ Object
10 11 12 13 |
# File 'lib/config_templates/models/compilation.rb', line 10 def select(expression) @context.criteria ::ConfigTemplates::Criteria::Name.new expression self end |
#send_to(output_name) ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/config_templates/models/compilation.rb', line 20 def send_to(output_name) @context.components.tap do |collection| collection.find_all.each &:render collection.find_all.each &:validate! output = @outputs.find_by_name output_name collection.find_all.each { |component| output.write component } end end |