class Google::Cloud::Trace::SpanKind

SpanKind represents values for the “kind” field of span.

Constants

RPC_CLIENT

The `:RPC_CLIENT` value

RPC_SERVER

The `:RPC_SERVER` value

UNSPECIFIED

The `:SPAN_KIND_UNSPECIFIED` value

Public Class Methods

get(name) click to toggle source

Returns the SpanKind given a symbol or string representation.

@param [String, Symbol] name The name of the SpanKind. @return [SpanKind] The SpanKind, or `nil` if not known.

# File lib/google/cloud/trace/span_kind.rb, line 74
def self.get name
  @@mapping[name.to_sym]
end
new(name) click to toggle source

Create a new SpanKind.

@private

# File lib/google/cloud/trace/span_kind.rb, line 30
def initialize name
  @name = name
  @@mapping[name] = self
end

Public Instance Methods

to_s() click to toggle source

Returns the string representation of this SpanKind

@return [String] String representation.

# File lib/google/cloud/trace/span_kind.rb, line 64
def to_s
  to_sym.to_s
end
to_sym() click to toggle source

Returns the symbolic representation of this SpanKind

@return [Symbol] Symbol representation.

# File lib/google/cloud/trace/span_kind.rb, line 55
def to_sym
  @name
end