Class: Traces::Backend::Test::Span

Inherits:
Object
  • Object
show all
Defined in:
lib/traces/backend/test.rb

Overview

A span which validates tag assignment.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

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