lib/url_categorise/client.rb in UrlCategorise-0.0.2 vs lib/url_categorise/client.rb in UrlCategorise-0.0.3
- old
+ new
@@ -39,14 +39,16 @@
private
def hash_size_in_mb(hash)
size = 0
+
hash.each do |key, value|
size += value.join.length
end
- (size / 1.megabyte).round(2)
+
+ (size / ONE_MEGABYTE).round(2)
end
def fetch_and_build_host_lists
@hosts = {}
@@ -61,10 +63,10 @@
extra_category_values = sub_category_values[category].each do |sub_category|
@hosts[sub_category]
end
original_value << extra_category_values
- @hosts[category] = original_value
+ @hosts[category] = original_value.uniq.compact
end
@hosts
end