Sha256: 2fde4995c7e37ac62e7c283382d6d47b345d858815c0521a4488be2724e581a6

Contents?: true

Size: 510 Bytes

Versions: 18

Compression:

Stored size: 510 Bytes

Contents

require "logtail/context"

module Logtail
  module Contexts
    # @private
    class Runtime < Context
      attr_reader :thread_id

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

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

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
logtail-ruby-0.1.3 lib/logtail/contexts/runtime.rb
logtail-0.1.13 lib/logtail/contexts/runtime.rb
logtail-0.1.12 lib/logtail/contexts/runtime.rb
logtail-0.1.11 lib/logtail/contexts/runtime.rb
logtail-0.1.10 lib/logtail/contexts/runtime.rb
logtail-0.1.9 lib/logtail/contexts/runtime.rb
logtail-0.1.8 lib/logtail/contexts/runtime.rb
logtail-0.1.7 lib/logtail/contexts/runtime.rb
logtail-0.1.6 lib/logtail/contexts/runtime.rb
logtail-0.1.5 lib/logtail/contexts/runtime.rb
logtail-0.1.4 lib/logtail/contexts/runtime.rb
logtail-0.1.3 lib/logtail/contexts/runtime.rb
logtail-0.1.2 lib/logtail/contexts/runtime.rb
logtail-0.1.1 lib/logtail/contexts/runtime.rb
logtail-0.1.0 lib/logtail/contexts/runtime.rb
logtail-ruby-0.1.2 lib/logtail/contexts/runtime.rb
logtail-ruby-0.1.1 lib/logtail/contexts/runtime.rb
logtail-ruby-0.1.0 lib/logtail/contexts/runtime.rb