Class: Timber::Contexts::Runtime
- Inherits:
-
Timber::Context
- Object
- Timber::Context
- Timber::Contexts::Runtime
- Defined in:
- lib/timber/contexts/runtime.rb
Overview
Tracks OS level process information, such as the process ID.
Instance Attribute Summary collapse
-
#application ⇒ Object
readonly
Returns the value of attribute application.
-
#class_name ⇒ Object
readonly
Returns the value of attribute class_name.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#function ⇒ Object
readonly
Returns the value of attribute function.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#module_name ⇒ Object
readonly
Returns the value of attribute module_name.
Instance Method Summary collapse
- #as_json(_options = {}) ⇒ Object
-
#initialize(attributes) ⇒ Runtime
constructor
A new instance of Runtime.
Constructor Details
#initialize(attributes) ⇒ Runtime
Returns a new instance of Runtime.
9 10 11 12 13 14 15 16 |
# File 'lib/timber/contexts/runtime.rb', line 9 def initialize(attributes) @application = attributes[:application] @class_name = attributes[:class_name] @file = attributes[:file] @function = attributes[:function] @line = attributes[:line] @module_name = attributes[:module_name] end |
Instance Attribute Details
#application ⇒ Object (readonly)
Returns the value of attribute application.
7 8 9 |
# File 'lib/timber/contexts/runtime.rb', line 7 def application @application end |
#class_name ⇒ Object (readonly)
Returns the value of attribute class_name.
7 8 9 |
# File 'lib/timber/contexts/runtime.rb', line 7 def class_name @class_name end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
7 8 9 |
# File 'lib/timber/contexts/runtime.rb', line 7 def file @file end |
#function ⇒ Object (readonly)
Returns the value of attribute function.
7 8 9 |
# File 'lib/timber/contexts/runtime.rb', line 7 def function @function end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
7 8 9 |
# File 'lib/timber/contexts/runtime.rb', line 7 def line @line end |
#module_name ⇒ Object (readonly)
Returns the value of attribute module_name.
7 8 9 |
# File 'lib/timber/contexts/runtime.rb', line 7 def module_name @module_name end |
Instance Method Details
#as_json(_options = {}) ⇒ Object
18 19 20 21 |
# File 'lib/timber/contexts/runtime.rb', line 18 def as_json( = {}) {application: application, class_name: class_name, file: file, function: function, line: line, module_name: module_name} end |