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 |
# File 'lib/config_templates/models/compilation.rb', line 20 def send_to(output_name) @context.components.tap do |components| output = outputs.find_by_name output_name components.each &:validate! components.each { |component| output.print component } end end |