module Auth::Sanitizer::FilteredAttributes::ClassMethods

Class-level helpers for configuring filtered attributes.

Public Class Methods

filtered_attribute_names(base) click to toggle source

The configured attribute names to filter.

@param [Class] base The class to get filtered attributes for @return [Array<Symbol>]

   # File lib/auth/sanitizer/filtered_attributes.rb
60 def filtered_attribute_names(base)
61   return [] unless base.instance_variable_defined?(:@filtered_attribute_names)
62 
63   base.instance_variable_get(:@filtered_attribute_names) || []
64 end
filtered_attributes(base, *attributes) click to toggle source

Declare attributes that should be redacted in inspect output.

@param [Array<Symbol, String>] attributes One or more attribute names @return [void]

   # File lib/auth/sanitizer/filtered_attributes.rb
52 def filtered_attributes(base, *attributes)
53   base.instance_variable_set(:@filtered_attribute_names, attributes.map(&:to_sym))
54 end

Public Instance Methods

filtered_attribute_names() click to toggle source

The configured attribute names to filter.

@return [Array<Symbol>]

   # File lib/auth/sanitizer/filtered_attributes.rb
78 def filtered_attribute_names
79   ClassMethods.filtered_attribute_names(self)
80 end
filtered_attributes(*attributes) click to toggle source

Declare attributes that should be redacted in inspect output.

@param [Array<Symbol, String>] attributes One or more attribute names @return [void]

   # File lib/auth/sanitizer/filtered_attributes.rb
71 def filtered_attributes(*attributes)
72   ClassMethods.filtered_attributes(self, *attributes)
73 end