Module: Castle::Payload::Prepare
- Defined in:
- lib/castle/payload/prepare.rb
Overview
prepares payload based on the request
Class Method Summary collapse
Class Method Details
.call(payload_options, request, options = {}) ⇒ Hash
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/castle/payload/prepare.rb', line 12 def call(, request, = {}) context = Castle::Context::Prepare.call(request, .merge()) payload = Castle::Utils::DeepSymbolizeKeys.call( || {}).merge(context: context) payload[:timestamp] ||= Castle::Utils::GetTimestamp.call warn '[DEPRECATION] use user_traits instead of traits key' if payload.key?(:traits) payload end |