Class: Yrpc::Controllers::ServiceBinder
- Inherits:
-
Object
- Object
- Yrpc::Controllers::ServiceBinder
- Defined in:
- lib/yrpc/controllers/service_binder.rb
Defined Under Namespace
Classes: BoundDesc
Instance Method Summary collapse
-
#bind!(controller) ⇒ Object
通过controller绑定所有的方法.
-
#initialize(service) ⇒ ServiceBinder
constructor
初始化。。没什么好解释的.
- #rpc_desc(request_method) ⇒ Object
Constructor Details
#initialize(service) ⇒ ServiceBinder
初始化。。没什么好解释的
12 13 14 |
# File 'lib/yrpc/controllers/service_binder.rb', line 12 def initialize(service) @service = service end |
Instance Method Details
#bind!(controller) ⇒ Object
通过controller绑定所有的方法
18 19 20 |
# File 'lib/yrpc/controllers/service_binder.rb', line 18 def bind!(controller) rpc_methods.each { |name, desc| bind_method(controller, name, desc) } end |
#rpc_desc(request_method) ⇒ Object
22 23 24 |
# File 'lib/yrpc/controllers/service_binder.rb', line 22 def rpc_desc(request_method) @service.rpc_descs[request_method] end |