Class: ConfigurationVisitor
- Inherits:
-
Object
- Object
- ConfigurationVisitor
- Defined in:
- lib/visitors/configuration_visitor.rb
Class Method Summary collapse
Class Method Details
.GenerateIDs ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/visitors/configuration_visitor.rb', line 18 def self.GenerateIDs configurationsHash = self.Visit configurationsHash.each do |rule,configurations| configurations.each do |configuration| configuration.id = "#{rule}-#{configuration.name.downcase.gsub! ' ', '_'}" end end end |
.Visit ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/visitors/configuration_visitor.rb', line 4 def self.Visit configurationsHash = {} rules = RuleEngine.rules rules.each do |rule| configurationsHash[rule] = [] rule.configurations.each do |configuration| configurationsHash[rule].append(configuration) end end return configurationsHash end |