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
10
11
12
13
14
|
# File 'lib/httpx/plugins/grpc/call.rb', line 10
def initialize(response)
@response = response
@decoder = ->(z) { z }
@consumed = false
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, *args, &blk) ⇒ Object
56
57
58
59
60
|
# File 'lib/httpx/plugins/grpc/call.rb', line 56
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
16
17
18
|
# File 'lib/httpx/plugins/grpc/call.rb', line 16
def inspect
"#GRPC::Call(#{grpc_response})"
end
|
24
25
26
|
# File 'lib/httpx/plugins/grpc/call.rb', line 24
def metadata
response.
end
|
#to_s ⇒ Object
20
21
22
|
# File 'lib/httpx/plugins/grpc/call.rb', line 20
def to_s
grpc_response.to_s
end
|
28
29
30
31
32
|
# File 'lib/httpx/plugins/grpc/call.rb', line 28
def trailing_metadata
return unless @consumed
@response.trailing_metadata
end
|