Module: Olyx::Guardrails::Notification::Metadata
- Defined in:
- lib/olyx/guardrails/notification/metadata.rb
Overview
Bounds, sanitizes, and collision-proofs notification metadata.
Constant Summary collapse
- MAX_ENTRIES =
20- KEY_LENGTH =
50
Class Method Summary collapse
Class Method Details
.call(metadata, sanitizer) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/olyx/guardrails/notification/metadata.rb', line 13 def call(, sanitizer) .first(MAX_ENTRIES).each_with_object({}) do |(key, value), output| safe_key = unique_key(sanitizer.key(key), output) output[safe_key] = sanitizer.field(value) end end |