Class: GrpcRest::GeneratedService
- Inherits:
-
Object
- Object
- GrpcRest::GeneratedService
- Defined in:
- lib/generator/service.rb
Instance Attribute Summary collapse
-
#methods ⇒ Object
Returns the value of attribute methods.
-
#service ⇒ Object
Returns the value of attribute service.
Instance Method Summary collapse
-
#initialize(service) ⇒ GeneratedService
constructor
A new instance of GeneratedService.
- #name ⇒ String
Constructor Details
#initialize(service) ⇒ GeneratedService
Returns a new instance of GeneratedService.
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/generator/service.rb', line 10 def initialize(service) @service = service # this will return a Google::Protobuf::ServiceDescriptor @service_proto = Google::Protobuf::DescriptorPool.generated_pool.lookup(service.service_name) @methods = [] @service_proto.each do |m| # m is a Google::Protobuf::MethodDescriptor @methods.push(GrpcRest::GeneratedMethod.new(m)) end end |
Instance Attribute Details
#methods ⇒ Object
Returns the value of attribute methods.
7 8 9 |
# File 'lib/generator/service.rb', line 7 def methods @methods end |
#service ⇒ Object
Returns the value of attribute service.
7 8 9 |
# File 'lib/generator/service.rb', line 7 def service @service end |
Instance Method Details
#name ⇒ String
22 23 24 |
# File 'lib/generator/service.rb', line 22 def name @service_proto.name.split('.').map(&:camelcase).join('::').demodulize end |