Class: ConfigTemplates::Models::Compilation
- Inherits:
-
Object
- Object
- ConfigTemplates::Models::Compilation
- Defined in:
- lib/config_templates/models/compilation.rb
Instance Method Summary collapse
-
#initialize ⇒ Compilation
constructor
A new instance of Compilation.
- #reject(expression) ⇒ Object
- #select(expression) ⇒ Object
- #send_to(output_name) ⇒ Object
Constructor Details
#initialize ⇒ Compilation
Returns a new instance of Compilation.
3 4 5 6 |
# File 'lib/config_templates/models/compilation.rb', line 3 def initialize @config = ::ConfigTemplates.config @context = ::ConfigTemplates::Contexts::Compilation.new end |
Instance Method Details
#reject(expression) ⇒ Object
13 14 15 16 |
# File 'lib/config_templates/models/compilation.rb', line 13 def reject(expression) @context.criteria ::ConfigTemplates::Criteria::Name.new expression, false self end |
#select(expression) ⇒ Object
8 9 10 11 |
# File 'lib/config_templates/models/compilation.rb', line 8 def select(expression) @context.criteria ::ConfigTemplates::Criteria::Name.new expression self end |
#send_to(output_name) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/config_templates/models/compilation.rb', line 18 def send_to(output_name) @context.renderers.each do |renderer| renderer.validate! output = @config.output output_name output.print renderer end end |