Class: Messages::Metadata
Class Method Summary collapse
Class Method Details
.wrap(message, *args, expires_at: nil, expires_in: nil, purpose: nil) ⇒ Object
2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 |
# File 'lib/brick.rb', line 2054 def self.wrap(, *args, expires_at: nil, expires_in: nil, purpose: nil) if 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 |