Class: WhiskeyDisk::Config::LocalizeDomainsFilter
Instance Attribute Summary
#config
Instance Method Summary
collapse
#environment_name, #initialize, #project_name
Instance Method Details
#filter(data) ⇒ Object
18
19
20
|
# File 'lib/whiskey_disk/config/filters/localize_domains_filter.rb', line 18
def filter(data)
data.merge('domain' => localize_domains(data['domain']))
end
|
#is_local?(name) ⇒ Boolean
6
7
8
|
# File 'lib/whiskey_disk/config/filters/localize_domains_filter.rb', line 6
def is_local?(name)
name.nil? or name == ''
end
|
#localize(name) ⇒ Object
10
11
12
|
# File 'lib/whiskey_disk/config/filters/localize_domains_filter.rb', line 10
def localize(name)
is_local?(name) ? 'local' : name
end
|
#localize_domains(domain_list) ⇒ Object
14
15
16
|
# File 'lib/whiskey_disk/config/filters/localize_domains_filter.rb', line 14
def localize_domains(domain_list)
domain_list.collect {|domain| domain.merge('name' => localize(domain['name'])) }
end
|