Class: Ritsu::SrcFiles::ProjectConfigHeaderTemplateFile::Template
- Inherits:
-
Template
- Object
- Template
- Ritsu::SrcFiles::ProjectConfigHeaderTemplateFile::Template
- Includes:
- TemplatePolicies::DoNotUpdate
- Defined in:
- lib/ritsu/src_files/project_config_header_template_file.rb
Instance Attribute Summary collapse
-
#src_file ⇒ Object
readonly
Returns the value of attribute src_file.
Attributes included from BlockMixin
#contents, #id, #indent_length, #indent_level, #local_indentation
Instance Method Summary collapse
-
#initialize(src_file) ⇒ Template
constructor
A new instance of Template.
- #project ⇒ Object
Methods included from TemplatePolicies::DoNotUpdate
Methods inherited from Template
#add_content, #add_template, #child_template_with_id, #child_template_with_id_position, #child_templates, #create_block, #update_block
Methods included from BlockMixin
#add_line, #add_new_line, #block_structure?, #clear_contents, #indent, #initialize_block_mixin, #outdent
Constructor Details
#initialize(src_file) ⇒ Template
Returns a new instance of Template.
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/ritsu/src_files/project_config_header_template_file.rb', line 16 def initialize(src_file) @src_file = src_file super("ProjectConfigHeaderTemplateFile -- #{project.name}") add_line "#ifndef __#{project.name.underscore.upcase}_CONFIG_H__" add_line "#define __#{project.name.underscore.upcase}_CONFIG_H__" add_new_line add_line "#cmakedefine __WIN_PLATFORM__" add_line "#cmakedefine __MAC_PLATFORM__" add_line "#cmakedefine __UNIX_PLATFORM__" add_new_line add_line "#endif" end |
Instance Attribute Details
#src_file ⇒ Object (readonly)
Returns the value of attribute src_file.
14 15 16 |
# File 'lib/ritsu/src_files/project_config_header_template_file.rb', line 14 def src_file @src_file end |
Instance Method Details
#project ⇒ Object
30 31 32 |
# File 'lib/ritsu/src_files/project_config_header_template_file.rb', line 30 def project src_file.project end |