Class: Lnrpc::GrpcWrapper
- Inherits:
-
Object
- Object
- Lnrpc::GrpcWrapper
- Defined in:
- lib/lnrpc/grpc_wrapper.rb
Instance Attribute Summary collapse
-
#grpc ⇒ Object
readonly
Returns the value of attribute grpc.
-
#service ⇒ Object
readonly
Returns the value of attribute service.
Instance Method Summary collapse
-
#initialize(service:, grpc:) ⇒ GrpcWrapper
constructor
A new instance of GrpcWrapper.
- #inspect ⇒ Object
- #method_missing(m, *args, &block) ⇒ Object
Constructor Details
#initialize(service:, grpc:) ⇒ GrpcWrapper
5 6 7 8 |
# File 'lib/lnrpc/grpc_wrapper.rb', line 5 def initialize(service:, grpc:) @grpc = grpc @service = service end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *args, &block) ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/lnrpc/grpc_wrapper.rb', line 10 def method_missing(m, *args, &block) if grpc.respond_to?(m) params = args[0] args[0] = params.nil? ? request_class_for(m).new : request_class_for(m).new(params) grpc.send(m, *args, &block) else super end end |
Instance Attribute Details
#grpc ⇒ Object (readonly)
Returns the value of attribute grpc.
3 4 5 |
# File 'lib/lnrpc/grpc_wrapper.rb', line 3 def grpc @grpc end |
#service ⇒ Object (readonly)
Returns the value of attribute service.
3 4 5 |
# File 'lib/lnrpc/grpc_wrapper.rb', line 3 def service @service end |
Instance Method Details
#inspect ⇒ Object
21 22 23 |
# File 'lib/lnrpc/grpc_wrapper.rb', line 21 def inspect "#{self} @grpc=\"#{grpc}\"" end |