Class: TemplateBuilder::App::FileAnalyzer::FileParameter

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/template_builder/app/file_analyzer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFileParameter

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

#parametersObject (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_fileObject



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_fileObject



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_namesObject



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