Class: Ritsu::SrcFiles::TargetCmakeLists::CustomCommandsTemplate

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

Instance Attribute Summary collapse

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(target) ⇒ CustomCommandsTemplate

Returns a new instance of CustomCommandsTemplate.



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

def initialize(target)
  super("TargetCmakeLists -- #{target.name} -- Custom Commands")
  @target = target
end

Instance Attribute Details

#targetObject

Returns the value of attribute target.



44
45
46
# File 'lib/ritsu/src_files/target_cmake_lists.rb', line 44

def target
  @target
end

Instance Method Details

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



51
52
53
54
55
56
# File 'lib/ritsu/src_files/target_cmake_lists.rb', line 51

def update_block(block, options = {})
  block.contents.clear
  target.custom_commands.each do |custom_command|
    block.contents << custom_command.to_s
  end
end