Class: Timber::Contexts::Runtime

Inherits:
Timber::Context
  • Object
show all
Defined in:
lib/timber/contexts/runtime.rb

Overview

Tracks OS level process information, such as the process ID.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#applicationObject (readonly)

Returns the value of attribute application.



7
8
9
# File 'lib/timber/contexts/runtime.rb', line 7

def application
  @application
end

#class_nameObject (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

#fileObject (readonly)

Returns the value of attribute file.



7
8
9
# File 'lib/timber/contexts/runtime.rb', line 7

def file
  @file
end

#functionObject (readonly)

Returns the value of attribute function.



7
8
9
# File 'lib/timber/contexts/runtime.rb', line 7

def function
  @function
end

#lineObject (readonly)

Returns the value of attribute line.



7
8
9
# File 'lib/timber/contexts/runtime.rb', line 7

def line
  @line
end

#module_nameObject (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(_options = {})
  {application: application, class_name: class_name, file: file, function: function,
    line: line, module_name: module_name}
end