Grooming.

master
Luka Vandervelden 2019-10-28 06:37:57 +01:00
parent 86f3294689
commit 3a3db5bde1
1 changed files with 9 additions and 11 deletions

View File

@ -26,6 +26,7 @@ module GenConfig
Array(String) | Array(Variables) | Array(String) | Array(Variables) |
Hash(String, String) | Hash(String, Variables) | Hash(String, String) | Hash(String, Variables) |
Array(Hash(String, String?)) | Array(Hash(String, String?)) |
Hash(String, Array(Hash(String, String?))) |
Hash(String, String?) | Hash(String, String?) |
Crinja::Callable::Instance Crinja::Callable::Instance
@ -96,23 +97,20 @@ class GenConfig::Context
options["service"] = service.to_genconfig options["service"] = service.to_genconfig
providers = Hash(String, Variables).new options["providers"] = service.providers.compact_map do |token, provider|
service.providers.each do |token, provider|
provider = Service.get_by_id provider provider = Service.get_by_id provider
next unless provider next unless provider
providers[token] = provider.to_genconfig provider.to_genconfig
end end
options["providers"] = providers
consumers = Hash(String, Variables).new options["consumers"] = service.provides
service.provides.each do |provider_data| .map(&.token)
token = provider_data.token .map{ |token|
{token, service.get_consumers(token).map &.to_genconfig}
consumers[token] = service.get_consumers(token).map &.to_genconfig }
end .to_h
options["consumers"] = consumers
end end
end end