Class: Timber::Contexts::System
- Inherits:
-
Timber::Context
- Object
- Timber::Context
- Timber::Contexts::System
- Defined in:
- lib/timber/contexts/system.rb
Overview
Tracks OS level process information, such as the process ID.
Instance Attribute Summary collapse
-
#pid ⇒ Object
readonly
Returns the value of attribute pid.
Instance Method Summary collapse
- #as_json(_options = {}) ⇒ Object
-
#initialize(attributes) ⇒ System
constructor
A new instance of System.
Constructor Details
#initialize(attributes) ⇒ System
Returns a new instance of System.
9 10 11 12 |
# File 'lib/timber/contexts/system.rb', line 9 def initialize(attributes) @pid = attributes[:pid] || raise(ArgumentError.new(":pid is required")) @pid = @pid.to_s end |
Instance Attribute Details
#pid ⇒ Object (readonly)
Returns the value of attribute pid.
7 8 9 |
# File 'lib/timber/contexts/system.rb', line 7 def pid @pid end |
Instance Method Details
#as_json(_options = {}) ⇒ Object
14 15 16 |
# File 'lib/timber/contexts/system.rb', line 14 def as_json( = {}) {pid: Timber::Util::Object.try(pid, :to_s)} end |