lib/approvals/writers/hash_writer.rb in approvals-0.0.12 vs lib/approvals/writers/hash_writer.rb in approvals-0.0.13

- old
+ new

@@ -1,14 +1,19 @@ module Approvals module Writers class HashWriter < TextWriter def format(data) - lines = data.map do |key, value| + lines = filter(data).map do |key, value| "\t#{key.inspect} => #{value.inspect}" end.join("\n") "{\n#{lines}\n}\n" + end + + def filter data + filter = ::Approvals::Filter.new(Approvals.configuration.excluded_json_keys) + filter.apply(data) end end end end