Module: FilterHash

Defined in:
lib/console/rails/filter_hash.rb

Class Method Summary collapse

Class Method Details

.safe_values(h) ⇒ Object



2
3
4
5
6
7
8
9
10
# File 'lib/console/rails/filter_hash.rb', line 2

def self.safe_values(h)
  tests = filters
  out = nil
  h.keys.each do |k|
    key_s = k.to_s.downcase
    (out ||= h.dup)[k] = '[FILTERED]' if tests.any?{ |s| key_s.include?(s) }
  end
  out || h
end