class WhiskeyDisk::Config::HashifyDomainEntriesFilter
Public Instance Methods
filter(data)
click to toggle source
# File lib/whiskey_disk/config/filters/hashify_domain_entries_filter.rb, line 23 def filter(data) data.merge('domain' => hashify_domains(data['domain'])) end
hashify_domain(domain)
click to toggle source
# File lib/whiskey_disk/config/filters/hashify_domain_entries_filter.rb, line 10 def hashify_domain(domain) needs_hashing?(domain) ? { 'name' => domain } : domain end
hashify_domains(domain_list)
click to toggle source
# File lib/whiskey_disk/config/filters/hashify_domain_entries_filter.rb, line 18 def hashify_domains(domain_list) return new_domain unless domain_list [ domain_list ].flatten.collect {|domain| hashify_domain(domain) } end
needs_hashing?(domain)
click to toggle source
# File lib/whiskey_disk/config/filters/hashify_domain_entries_filter.rb, line 6 def needs_hashing?(domain) ! domain.respond_to?(:keys) end
new_domain()
click to toggle source
# File lib/whiskey_disk/config/filters/hashify_domain_entries_filter.rb, line 14 def new_domain { 'name' => '' } end