Class: HTTPX::Plugins::GRPC::Call
- Inherits:
-
Object
- Object
- HTTPX::Plugins::GRPC::Call
show all
- Defined in:
- lib/httpx/plugins/grpc/call.rb
Overview
Encapsulates call information
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(response) ⇒ Call
Returns a new instance of Call.
10
11
12
13
14
15
|
# File 'lib/httpx/plugins/grpc/call.rb', line 10
def initialize(response)
@response = response
@decoder = ->(z) { z }
@consumed = false
@grpc_response = nil
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, *args, &blk) ⇒ Object
55
56
57
58
59
|
# File 'lib/httpx/plugins/grpc/call.rb', line 55
def method_missing(meth, *args, &blk)
return grpc_response.__send__(meth, *args, &blk) if grpc_response.respond_to?(meth)
super
end
|
Instance Attribute Details
#decoder=(value) ⇒ Object
Sets the attribute decoder
8
9
10
|
# File 'lib/httpx/plugins/grpc/call.rb', line 8
def decoder=(value)
@decoder = value
end
|
Instance Method Details
#inspect ⇒ Object
17
18
19
|
# File 'lib/httpx/plugins/grpc/call.rb', line 17
def inspect
"#GRPC::Call(#{grpc_response})"
end
|
25
26
27
|
# File 'lib/httpx/plugins/grpc/call.rb', line 25
def metadata
response.
end
|
#to_s ⇒ Object
21
22
23
|
# File 'lib/httpx/plugins/grpc/call.rb', line 21
def to_s
grpc_response.to_s
end
|
29
30
31
32
33
|
# File 'lib/httpx/plugins/grpc/call.rb', line 29
def trailing_metadata
return unless @consumed
@response.trailing_metadata
end
|