Class: Gruf::Controllers::ServiceBinder
- Inherits:
-
Object
- Object
- Gruf::Controllers::ServiceBinder
- Defined in:
- lib/gruf/controllers/service_binder.rb
Overview
Binds gRPC services to a gruf controller
Defined Under Namespace
Classes: BoundDesc
Instance Method Summary collapse
-
#bind!(controller) ⇒ Object
Bind all methods on the service to the passed controller.
-
#initialize(service) ⇒ ServiceBinder
constructor
Initialize a service binder instance with the given service.
Constructor Details
#initialize(service) ⇒ ServiceBinder
Initialize a service binder instance with the given service
32 33 34 |
# File 'lib/gruf/controllers/service_binder.rb', line 32 def initialize(service) @service = service end |
Instance Method Details
#bind!(controller) ⇒ Object
Bind all methods on the service to the passed controller
41 42 43 |
# File 'lib/gruf/controllers/service_binder.rb', line 41 def bind!(controller) rpc_methods.each { |name, desc| bind_method(controller, name, desc) } end |