Sha256: 54773ff43ddb3b3411c3774e4200bbec50e0b63d175e97ca8ab5578d17e93c9e

Contents?: true

Size: 438 Bytes

Versions: 21

Compression:

Stored size: 438 Bytes

Contents

module Timber
  module Contexts
    # Tracks OS level process information, such as the process ID.
    class System < Context
      @keyspace = :system

      attr_reader :pid

      def initialize(attributes)
        @pid = attributes[:pid] || raise(ArgumentError.new(":pid is required"))
        @pid = @pid.to_s
      end

      def as_json(_options = {})
        {pid: Timber::Util::Object.try(pid, :to_s)}
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
timber-1.1.4 lib/timber/contexts/system.rb