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 base [Class] The class to get filtered attributes for @return [Array<Symbol>]

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

Declare attributes that should be redacted in inspect output.

@param base [Class] The class the attributes are declared on @param attributes [Array<Symbol, String>] One or more attribute names @return [void]

   # File lib/auth/sanitizer/filtered_attributes.rb
51 def filtered_attributes(base, *attributes)
52   base.instance_variable_set(:@filtered_attribute_names, attributes.map(&:to_sym))
53 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
77 def filtered_attribute_names
78   ClassMethods.filtered_attribute_names(self)
79 end
filtered_attributes(*attributes) click to toggle source

Declare attributes that should be redacted in inspect output.

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

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