Class: Timber::Contexts::System
- Inherits:
-
Timber::Context
- Object
- Timber::Context
- Timber::Contexts::System
- Defined in:
- lib/timber/contexts/system.rb
Overview
Note:
This is tracked automatically in Timber::CurrentContext. When the current context is initialized, the system context gets added automatically.
The system context tracks OS level process information, such as the process ID.
Instance Attribute Summary collapse
-
#hostname ⇒ Object
readonly
Returns the value of attribute hostname.
-
#pid ⇒ Object
readonly
Returns the value of attribute pid.
Instance Method Summary collapse
-
#as_json(_options = {}) ⇒ Object
Builds a hash representation containing simple objects, suitable for serialization (JSON).
-
#initialize(attributes) ⇒ System
constructor
A new instance of System.
Constructor Details
Instance Attribute Details
#hostname ⇒ Object (readonly)
Returns the value of attribute hostname.
13 14 15 |
# File 'lib/timber/contexts/system.rb', line 13 def hostname @hostname end |
#pid ⇒ Object (readonly)
Returns the value of attribute pid.
13 14 15 |
# File 'lib/timber/contexts/system.rb', line 13 def pid @pid end |
Instance Method Details
#as_json(_options = {}) ⇒ Object
Builds a hash representation containing simple objects, suitable for serialization (JSON).
21 22 23 |
# File 'lib/timber/contexts/system.rb', line 21 def as_json( = {}) {hostname: hostname, pid: pid} end |