Module: Cogger::Formatters::Sanitizers

Defined in:
lib/cogger/formatters/sanitizers/escape.rb,
lib/cogger/formatters/sanitizers/filter.rb,
lib/cogger/formatters/sanitizers/format_time.rb

Defined Under Namespace

Classes: Escape

Constant Summary collapse

Filter =

Sanitizes/removes sensitive values.

lambda do |attributes, filters: Cogger.filters|
  filters.each { |key| attributes[key] = "[FILTERED]" if attributes.key? key }
  attributes
end
FormatTime =

Sanitizes/formats date/time value.

lambda do |value, format: Cogger::DATETIME_FORMAT|
  return value unless value.is_a?(::Time) || value.is_a?(Date) || value.is_a?(DateTime)

  value.strftime format
end