Class: Gruf::Zipkin::Method

Inherits:
Object
  • Object
show all
Defined in:
lib/gruf/zipkin/method.rb

Overview

Represents a Gruf gRPC method call

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(active_call, signature, request) ⇒ Method

Returns a new instance of Method

Parameters:

  • active_call (GRPC::ActiveCall)

    The gRPC ActiveCall object for this method

  • signature (String|Symbol)

    The method signature being called

  • request (Object)

    The gRPC request object being used


30
31
32
33
34
# File 'lib/gruf/zipkin/method.rb', line 30

def initialize(active_call, signature, request)
  @active_call = active_call
  @signature = signature.to_s.gsub('_without_intercept', '')
  @request = request
end

Instance Attribute Details

#active_callObject (readonly)

Returns the value of attribute active_call


23
24
25
# File 'lib/gruf/zipkin/method.rb', line 23

def active_call
  @active_call
end

#requestObject (readonly)

Returns the value of attribute request


23
24
25
# File 'lib/gruf/zipkin/method.rb', line 23

def request
  @request
end

#signatureObject (readonly)

Returns the value of attribute signature


23
24
25
# File 'lib/gruf/zipkin/method.rb', line 23

def signature
  @signature
end

Instance Method Details

#headersGruf::Zipkin::Headers


39
40
41
# File 'lib/gruf/zipkin/method.rb', line 39

def headers
  @headers ||= Gruf::Zipkin::Headers.new(@active_call)
end

#request_classString

Returns:

  • (String)

46
47
48
# File 'lib/gruf/zipkin/method.rb', line 46

def request_class
  @request.class.to_s
end