Class: MxxRu::Generators::CppBuildRoot::TemplateParams
- Inherits:
-
Object
- Object
- MxxRu::Generators::CppBuildRoot::TemplateParams
- Defined in:
- lib/mxx_ru/generators/cpp-build-root/g.rb
Overview
Class to be used in ERb template generation.
Usage:
template_params = TemplateParams.new( target_type, )
template = ERb.new( IO.read( some_template_file ) )
result = template.generate( template.get_binding )
Constant Summary collapse
- DEFAULT_BUILD_ROOT =
For a case when output_file is undetectable.
'build.rb'
Instance Attribute Summary collapse
-
#build_root_project ⇒ Object
readonly
Name of build root file.
Instance Method Summary collapse
-
#get_binding ⇒ Object
Returns binding to use in ERb generation.
-
#initialize(options) ⇒ TemplateParams
constructor
Param target_type must be present in @@setup_target_functions.
Constructor Details
#initialize(options) ⇒ TemplateParams
Param target_type must be present in @@setup_target_functions.
93 94 95 |
# File 'lib/mxx_ru/generators/cpp-build-root/g.rb', line 93 def initialize( ) @build_root_project = try_detect_build_root_project( ) end |
Instance Attribute Details
#build_root_project ⇒ Object (readonly)
Name of build root file.
90 91 92 |
# File 'lib/mxx_ru/generators/cpp-build-root/g.rb', line 90 def build_root_project @build_root_project end |
Instance Method Details
#get_binding ⇒ Object
Returns binding to use in ERb generation.
98 99 100 |
# File 'lib/mxx_ru/generators/cpp-build-root/g.rb', line 98 def get_binding binding end |