Class: TemplateBuilder::App::FileAnalyzer::FileParameter
- Inherits:
-
Object
- Object
- TemplateBuilder::App::FileAnalyzer::FileParameter
- Includes:
- Singleton
- Defined in:
- lib/template_builder/app/file_analyzer.rb
Instance Attribute Summary collapse
-
#parameters ⇒ Object
readonly
Returns the value of attribute parameters.
Instance Method Summary collapse
- #analyse_file ⇒ Object
-
#initialize ⇒ FileParameter
constructor
A new instance of FileParameter.
- #load_conf_file ⇒ Object
- #parameters_names ⇒ Object
- #priority(type_name) ⇒ Object
Constructor Details
#initialize ⇒ FileParameter
Returns a new instance of FileParameter.
34 35 36 37 38 |
# File 'lib/template_builder/app/file_analyzer.rb', line 34 def initialize @parameters = {} load_conf_file analyse_file end |
Instance Attribute Details
#parameters ⇒ Object (readonly)
Returns the value of attribute parameters.
32 33 34 |
# File 'lib/template_builder/app/file_analyzer.rb', line 32 def parameters @parameters end |
Instance Method Details
#analyse_file ⇒ Object
40 41 42 43 |
# File 'lib/template_builder/app/file_analyzer.rb', line 40 def analyse_file @config_file.each{ |k,v| @parameters[k.to_sym] = ["-#{k[0..0].to_s}", "--#{k} FRAMEWORK", "#{v['help'].capitalize} .", lambda { |item| @config_param[k.to_sym] = TemplateBuilder::App::Helper::Parameter.new :priority=>0,:name=>item }] } end |
#load_conf_file ⇒ Object
45 46 47 |
# File 'lib/template_builder/app/file_analyzer.rb', line 45 def load_conf_file @config_file = TemplateBuilder::App::FileAnalyzer.load_conf_file "parameter_file" end |
#parameters_names ⇒ Object
49 50 51 |
# File 'lib/template_builder/app/file_analyzer.rb', line 49 def parameters_names @parameters.each_key.to_a end |
#priority(type_name) ⇒ Object
53 54 55 |
# File 'lib/template_builder/app/file_analyzer.rb', line 53 def priority(type_name) @config_file[type_name.to_s]["priority"] end |