class Readme::Filter::RejectParams

Public Class Methods

new(filter_fields) click to toggle source
# File lib/readme/filter.rb, line 40
def initialize(filter_fields)
  @rejected_fields = filter_fields
end

Public Instance Methods

filter(hash) click to toggle source
# File lib/readme/filter.rb, line 44
def filter(hash)
  rejected_fields = @rejected_fields.map(&:downcase)
  rejected_params, allowed_params = hash.partition { |key, _value| rejected_fields.include?(key.downcase) }.map(&:to_h)

  allowed_params.merge(Filter.redact(rejected_params))
end
pass_through?() click to toggle source
# File lib/readme/filter.rb, line 51
def pass_through?
  false
end