62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
# File 'lib/facades/configuration_page_facade.rb', line 62
def self.ApplyConfigurations(new_conf)
@configurations_hash.each do |rule, configurations|
configurations.each do |configuration|
case configuration.displayfield
when DisplayField[:CheckBox]
if new_conf.has_key?(configuration.id)
configuration.value = true
else
configuration.value = false
end
when DisplayField[:SelectBox]
configuration.value = new_conf[configuration.id].split(/\r?\n/).delete_if(&:empty?)
when DisplayField[:RegexBox]
configuration.value = if new_conf[configuration.id].empty? then new_conf[configuration.id] else Regexp.new new_conf[configuration.id] end
else
configuration.value = new_conf[configuration.id]
end
end
end
end
|