Sha256: 9e617da1319d25e13508b703b78dd49a5a313ddabd4de437940610384a128db4

Contents?: true

Size: 495 Bytes

Versions: 2

Compression:

Stored size: 495 Bytes

Contents

require "timber/context"
require "timber/util"

module Timber
  module Contexts
    # @private
    class Session < Context
      attr_reader :id

      def initialize(attributes)
        @id = attributes[:id]
      end

      # Builds a hash representation containing simple objects, suitable for serialization (JSON).
      def to_hash
        @to_hash ||= {
          session: Util::NonNilHashBuilder.build do |h|
            h.add(:id, id)
          end
        }
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
timber-3.0.1 lib/timber/contexts/session.rb
timber-3.0.0 lib/timber/contexts/session.rb