Class: Datadog::Profiling::Collectors::CodeProvenance::Library
- Inherits:
-
Object
- Object
- Datadog::Profiling::Collectors::CodeProvenance::Library
- Defined in:
- lib/datadog/profiling/collectors/code_provenance.rb
Overview
Represents metadata we have for a ruby gem
Instance Attribute Summary collapse
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(kind:, name:, version:, path:) ⇒ Library
constructor
A new instance of Library.
- #to_json(arg = nil) ⇒ Object
Constructor Details
#initialize(kind:, name:, version:, path:) ⇒ Library
Returns a new instance of Library.
104 105 106 107 108 109 110 |
# File 'lib/datadog/profiling/collectors/code_provenance.rb', line 104 def initialize(kind:, name:, version:, path:) @kind = kind.freeze @name = name.dup.freeze @version = version.to_s.dup.freeze @path = path.dup.freeze freeze end |
Instance Attribute Details
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
102 103 104 |
# File 'lib/datadog/profiling/collectors/code_provenance.rb', line 102 def kind @kind end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
102 103 104 |
# File 'lib/datadog/profiling/collectors/code_provenance.rb', line 102 def name @name end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
102 103 104 |
# File 'lib/datadog/profiling/collectors/code_provenance.rb', line 102 def path @path end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
102 103 104 |
# File 'lib/datadog/profiling/collectors/code_provenance.rb', line 102 def version @version end |
Instance Method Details
#to_json(arg = nil) ⇒ Object
112 113 114 |
# File 'lib/datadog/profiling/collectors/code_provenance.rb', line 112 def to_json(arg = nil) { kind: @kind, name: @name, version: @version, paths: [@path] }.to_json(arg) end |