Class: ProtobufDescriptor::ServiceDescriptor

Inherits:
Object
  • Object
show all
Includes:
HasChildren, HasParent, NamedChild
Defined in:
lib/protobuf_descriptor/service_descriptor.rb

Overview

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HasChildren

#compute_source_code_info_path_component, included, #named_children

Methods included from NamedChild

#fully_qualified_java_name, #fully_qualified_name, #fully_qualified_ruby_name, #fully_qualified_wire_name, #inspect

Methods included from HasParent

#compute_source_code_info_path, #file_descriptor, #leading_comments, #protobuf_descriptor, #source_code_info_location, #source_code_info_locations, #source_code_info_span, #trailing_comments

Constructor Details

#initialize(parent, service_descriptor_proto) ⇒ ServiceDescriptor

Returns a new instance of ServiceDescriptor.



25
26
27
28
29
30
31
32
# File 'lib/protobuf_descriptor/service_descriptor.rb', line 25

def initialize(parent, service_descriptor_proto)
  @parent = parent
  @service_descriptor_proto = service_descriptor_proto
  @method = ProtobufDescriptor::NamedCollection.new(
      service_descriptor_proto.method.map { |m|
          ProtobufDescriptor::MethodDescriptor.new(self, m)
      })
end

Instance Attribute Details

#methodObject (readonly) Also known as: methods

Set of methods contained within this service, as a NamedCollection of MethodDescriptors



18
19
20
# File 'lib/protobuf_descriptor/service_descriptor.rb', line 18

def method
  @method
end

#parentObject (readonly)

The parent FileDescriptor



11
12
13
# File 'lib/protobuf_descriptor/service_descriptor.rb', line 11

def parent
  @parent
end

#service_descriptor_protoObject (readonly)

The +ServiceDescriptorProto+ this +ServiceDescriptor+ is wrapping



14
15
16
# File 'lib/protobuf_descriptor/service_descriptor.rb', line 14

def service_descriptor_proto
  @service_descriptor_proto
end

Instance Method Details

#nameObject

The name of the service



35
# File 'lib/protobuf_descriptor/service_descriptor.rb', line 35

def name; service_descriptor_proto.name; end

#optionsObject

The +ServiceOptions+ for this service.



38
# File 'lib/protobuf_descriptor/service_descriptor.rb', line 38

def options; service_descriptor_proto.options; end