Class: WhiskeyDisk::Config::ConvertRoleStringsToListFilter
- Inherits:
-
AbstractFilter
- Object
- AbstractFilter
- WhiskeyDisk::Config::ConvertRoleStringsToListFilter
show all
- Defined in:
- lib/whiskey_disk/config/filters/convert_role_strings_to_list_filter.rb
Instance Attribute Summary
#config
Instance Method Summary
collapse
#environment_name, #initialize, #project_name
Instance Method Details
#convert_all_roles(domains_list) ⇒ Object
11
12
13
|
# File 'lib/whiskey_disk/config/filters/convert_role_strings_to_list_filter.rb', line 11
def convert_all_roles(domains_list)
domains_list.collect {|domain| convert_roles_for_domain(domain) }
end
|
#convert_roles_for_domain(domain) ⇒ Object
6
7
8
9
|
# File 'lib/whiskey_disk/config/filters/convert_role_strings_to_list_filter.rb', line 6
def convert_roles_for_domain(domain)
return domain unless domain['roles']
domain.merge('roles' => [ domain['roles'] ].flatten)
end
|
#filter(data) ⇒ Object
15
16
17
|
# File 'lib/whiskey_disk/config/filters/convert_role_strings_to_list_filter.rb', line 15
def filter(data)
data.merge('domain' => convert_all_roles(data['domain']))
end
|