Class: Ritsu::SrcFiles::ProjectCmakeLists::CustomScriptTemplate

Inherits:
Template
  • Object
show all
Defined in:
lib/ritsu/src_files/project_cmake_lists.rb

Instance Attribute Summary

Attributes included from BlockMixin

#contents, #id, #indent_length, #indent_level, #local_indentation

Instance Method Summary collapse

Methods inherited from Template

#add_content, #add_template, #child_template_with_id, #child_template_with_id_position, #child_templates, #create_block

Methods included from BlockMixin

#add_line, #add_new_line, #block_structure?, #clear_contents, #indent, #initialize_block_mixin, #outdent

Constructor Details

#initialize(project) ⇒ CustomScriptTemplate

Returns a new instance of CustomScriptTemplate.



41
42
43
44
# File 'lib/ritsu/src_files/project_cmake_lists.rb', line 41

def initialize(project)
  super("ProjectCmakeLists -- Custom Script")
  @project = project
end

Instance Method Details

#update_block(block, options = {}) ⇒ Object



46
47
48
49
# File 'lib/ritsu/src_files/project_cmake_lists.rb', line 46

def update_block(block, options={})
  block.contents.clear
  block.contents << @project.custom_script
end