Class: SetupConfiguration::Generator::MPSTemplateBinding

Inherits:
TemplateBinding show all
Defined in:
lib/setup_configuration/mps_template_binding.rb

Instance Attribute Summary

Attributes inherited from TemplateBinding

#output, #suite

Instance Method Summary collapse

Methods inherited from TemplateBinding

#categories, #find_param_by_number, #get_binding

Constructor Details

#initialize {|_self| ... } ⇒ MPSTemplateBinding

Returns a new instance of MPSTemplateBinding.

Yields:

  • (_self)

Yield Parameters:



9
10
11
12
# File 'lib/setup_configuration/mps_template_binding.rb', line 9

def initialize
  yield self if block_given?
  @max_number_parameters_per_tab=50
end

Instance Method Details

#languagesObject



14
15
16
# File 'lib/setup_configuration/mps_template_binding.rb', line 14

def languages
  Translation.language_names
end

#param_infos(category_key) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/setup_configuration/mps_template_binding.rb', line 22

def param_infos(category_key)
  parameters=suite.categories[category_key]
  depends, machine_type, number, options, roles=[], [], [], [], []
  parameters.each() do |param|
    machine_type << param.machine_type
    number << param.number
    depends << depends_on(param.dependency)
    options << param.options
    roles << param.roles
  end
  #TODO compute value for max_number_parameters_per_tab of value maximum_numbers_per_category

  bundle = [depends, machine_type, number, options, roles].collect() { |arr| arr.in_groups_of(@max_number_parameters_per_tab, false) }
  bundle = sanitize(bundle)
  bundle.collect(){ |v| v.collect(){ |arr| prepare(arr) } }
end

#settingsObject



18
19
20
# File 'lib/setup_configuration/mps_template_binding.rb', line 18

def settings
  self.suite.settings
end