Class: Ritsu::SrcFiles::ExecutableCmakeLists::ExecutableTemplate
- Inherits:
-
Template
- Object
- Template
- Ritsu::SrcFiles::ExecutableCmakeLists::ExecutableTemplate
- Defined in:
- lib/ritsu/src_files/executable_cmake_lists.rb
Instance Attribute Summary collapse
-
#parent ⇒ Object
Returns the value of attribute parent.
-
#target ⇒ Object
Returns the value of attribute target.
Attributes included from BlockMixin
#contents, #id, #indent_length, #indent_level, #local_indentation
Instance Method Summary collapse
-
#initialize(target, parent) ⇒ ExecutableTemplate
constructor
A new instance of ExecutableTemplate.
- #update_block(block, options = {}) ⇒ Object
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(target, parent) ⇒ ExecutableTemplate
Returns a new instance of ExecutableTemplate.
10 11 12 13 14 |
# File 'lib/ritsu/src_files/executable_cmake_lists.rb', line 10 def initialize(target, parent) super("ExecutableCmakeLists -- #{target.name} -- Executable") @target = target @parent = parent end |
Instance Attribute Details
#parent ⇒ Object
Returns the value of attribute parent.
8 9 10 |
# File 'lib/ritsu/src_files/executable_cmake_lists.rb', line 8 def parent @parent end |
#target ⇒ Object
Returns the value of attribute target.
7 8 9 |
# File 'lib/ritsu/src_files/executable_cmake_lists.rb', line 7 def target @target end |
Instance Method Details
#update_block(block, options = {}) ⇒ Object
16 17 18 19 |
# File 'lib/ritsu/src_files/executable_cmake_lists.rb', line 16 def update_block(block, ={}) block.contents.clear block.contents << "ADD_EXECUTABLE(#{@target.name} ${#{@parent.source_files_template.src_files_var_name}})" end |