Class: Messages::Metadata
Class Method Summary collapse
Class Method Details
.wrap(message, *args, expires_at: nil, expires_in: nil, purpose: nil) ⇒ Object
1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 |
# File 'lib/brick.rb', line 1555 def self.wrap(, *args, expires_at: nil, expires_in: nil, purpose: nil) if args.length > 0 && args.last.is_a?(Hash) expires_at ||= args.last[:expires_at] expires_in ||= args.last[:expires_in] purpose ||= args.last[:purpose] end if expires_at || expires_in || purpose JSON.encode new(encode(), pick_expiry(expires_at, expires_in), purpose) else end end |