Sha256: 6a3be119dee824bad884825d60025b6ff9aa7a11e895bdac2eb6b8bf62211fde
Contents?: true
Size: 580 Bytes
Versions: 20
Compression:
Stored size: 580 Bytes
Contents
module Timber module Contexts # The user context tracks the currently authenticated user. # # @note This is tracked automatically with the `Integrations::Rack::UserContext` rack # middleware. class User < Context @keyspace = :user attr_reader :id, :name, :email def initialize(attributes) @id = attributes[:id] @name = attributes[:name] @email = attributes[:email] end def as_json(_options = {}) {id: Timber::Util::Object.try(id, :to_s), name: name, email: email} end end end end
Version data entries
20 entries across 20 versions & 1 rubygems