Class: Traces::Backend::Test::Span
- Inherits:
-
Object
- Object
- Traces::Backend::Test::Span
- Defined in:
- lib/traces/backend/test.rb
Overview
A span which validates tag assignment.
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
Instance Method Summary collapse
-
#[]=(key, value) ⇒ Object
Assign some metadata to the span.
-
#initialize(context) ⇒ Span
constructor
A new instance of Span.
Constructor Details
#initialize(context) ⇒ Span
Returns a new instance of Span.
36 37 38 |
# File 'lib/traces/backend/test.rb', line 36 def initialize(context) @context = context end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
40 41 42 |
# File 'lib/traces/backend/test.rb', line 40 def context @context end |
Instance Method Details
#[]=(key, value) ⇒ Object
Assign some metadata to the span.
45 46 47 48 49 50 51 52 53 |
# File 'lib/traces/backend/test.rb', line 45 def []= key, value unless key.is_a?(String) raise ArgumentError, "Invalid name!" end unless String(value) raise ArgumentError, "Invalid value!" end end |