Class: Logtail::Contexts::Runtime
- Inherits:
-
Logtail::Context
- Object
- Logtail::Context
- Logtail::Contexts::Runtime
- Defined in:
- lib/logtail/contexts/runtime.rb
Instance Attribute Summary collapse
-
#thread_id ⇒ Object
readonly
Returns the value of attribute thread_id.
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Runtime
constructor
A new instance of Runtime.
-
#to_hash ⇒ Object
Builds a hash representation containing simple objects, suitable for serialization (JSON).
Constructor Details
#initialize(attributes) ⇒ Runtime
Returns a new instance of Runtime.
9 10 11 |
# File 'lib/logtail/contexts/runtime.rb', line 9 def initialize(attributes) @thread_id = attributes[:thread_id] end |
Instance Attribute Details
#thread_id ⇒ Object (readonly)
Returns the value of attribute thread_id.
7 8 9 |
# File 'lib/logtail/contexts/runtime.rb', line 7 def thread_id @thread_id end |
Instance Method Details
#to_hash ⇒ Object
Builds a hash representation containing simple objects, suitable for serialization (JSON).
14 15 16 17 18 19 20 |
# File 'lib/logtail/contexts/runtime.rb', line 14 def to_hash @to_hash ||= { runtime: Util::NonNilHashBuilder.build do |h| h.add(:thread_id, thread_id) end } end |