Class: GRPCWeb::Client
- Inherits:
-
Object
- Object
- GRPCWeb::Client
- Defined in:
- lib/grpc_web/client/client.rb
Overview
GRPC Client implementation Example usage:
client = GRPCWeb::Client.new(“localhost:3000/grpc”, HelloService::Service) client.say_hello(name: ‘James’)
Instance Attribute Summary collapse
-
#base_url ⇒ Object
readonly
Returns the value of attribute base_url.
-
#service_interface ⇒ Object
readonly
Returns the value of attribute service_interface.
Instance Method Summary collapse
-
#initialize(base_url, service_interface) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(base_url, service_interface) ⇒ Client
Returns a new instance of Client.
14 15 16 17 18 19 20 21 |
# File 'lib/grpc_web/client/client.rb', line 14 def initialize(base_url, service_interface) self.base_url = base_url self.service_interface = service_interface service_interface.rpc_descs.each do |rpc_method, rpc_desc| define_rpc_method(rpc_method, rpc_desc) end end |
Instance Attribute Details
#base_url ⇒ Object
Returns the value of attribute base_url.
12 13 14 |
# File 'lib/grpc_web/client/client.rb', line 12 def base_url @base_url end |
#service_interface ⇒ Object
Returns the value of attribute service_interface.
12 13 14 |
# File 'lib/grpc_web/client/client.rb', line 12 def service_interface @service_interface end |