lib/paraduct/variable_converter.rb in paraduct-1.0.0.beta6 vs lib/paraduct/variable_converter.rb in paraduct-1.0.0
- old
+ new
@@ -23,12 +23,11 @@
end
product_variables
end
def self.reject(product_variables, exclude_variables)
- product_variables.inject([]) do |rejected_product_variables, variables|
- rejected_product_variables << variables unless exclude_variables.any?{ |exclude| partial_match?(variables, exclude) }
- rejected_product_variables
+ product_variables.each_with_object([]) do |variables, rejected_product_variables|
+ rejected_product_variables << variables unless exclude_variables.any? { |exclude| partial_match?(variables, exclude) }
end
end
def self.partial_match?(parent_hash, child_hash)
child_hash.each do |k, v|