Class: OpenTracing::Reference
- Inherits:
-
Object
- Object
- OpenTracing::Reference
- Defined in:
- lib/opentracing/reference.rb
Overview
:nodoc:
Constant Summary collapse
- CHILD_OF =
'child_of'.freeze
- FOLLOWS_FROM =
'follows_from'.freeze
Instance Attribute Summary collapse
-
#context ⇒ SpanContext
readonly
The context of a span this reference is referencing.
-
#type ⇒ String
readonly
Reference type.
Class Method Summary collapse
-
.child_of(context) ⇒ Reference
A ChildOf reference.
-
.follows_from(context) ⇒ Reference
A FollowsFrom reference.
Instance Method Summary collapse
-
#initialize(type, context) ⇒ Reference
constructor
A new instance of Reference.
Constructor Details
#initialize(type, context) ⇒ Reference
Returns a new instance of Reference.
68 69 70 71 |
# File 'lib/opentracing/reference.rb', line 68 def initialize(type, context) @type = type @context = context end |
Instance Attribute Details
#context ⇒ SpanContext (readonly)
Returns the context of a span this reference is referencing.
77 78 79 |
# File 'lib/opentracing/reference.rb', line 77 def context @context end |
#type ⇒ String (readonly)
Returns reference type.
74 75 76 |
# File 'lib/opentracing/reference.rb', line 74 def type @type end |
Class Method Details
.child_of(context) ⇒ Reference
Returns a ChildOf reference.
27 28 29 30 |
# File 'lib/opentracing/reference.rb', line 27 def self.child_of(context) context = context.context if context.is_a?(Span) Reference.new(CHILD_OF, context) end |
.follows_from(context) ⇒ Reference
Returns a FollowsFrom reference.
63 64 65 66 |
# File 'lib/opentracing/reference.rb', line 63 def self.follows_from(context) context = context.context if context.is_a?(Span) Reference.new(FOLLOWS_FROM, context) end |