Module: Ritsu::TemplatePolicies::Overwrite
- Included in:
- SrcFiles::ProjectCmakeLists::ConfigureFileTemplate, SrcFiles::ProjectCmakeLists::HeaderTemplate
- Defined in:
- lib/ritsu/template_policies.rb
Instance Method Summary collapse
Instance Method Details
#overwrite_block(block, options = {}) ⇒ Object
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/ritsu/template_policies.rb', line 37 def overwrite_block(block, ={}) block.clear_contents contents.each do |content| if !content.kind_of?(Ritsu::Template) block.add_content content else block.add_content(content.create_block()) end end end |
#update_block(block, options = {}) ⇒ Object
48 49 50 |
# File 'lib/ritsu/template_policies.rb', line 48 def update_block(block, ={}) overwrite_block(block, ) end |