Class: ProtobufDescriptor::EnumValueDescriptor

Inherits:
Object
  • Object
show all
Includes:
HasParent
Defined in:
lib/protobuf_descriptor/enum_value_descriptor.rb

Overview

Instance Attribute Summary collapse

Instance Method Summary collapse

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, enum_value_descriptor_proto) ⇒ EnumValueDescriptor

Returns a new instance of EnumValueDescriptor.



15
16
17
18
# File 'lib/protobuf_descriptor/enum_value_descriptor.rb', line 15

def initialize(parent, enum_value_descriptor_proto)
  @parent = parent
  @enum_value_descriptor_proto = enum_value_descriptor_proto
end

Instance Attribute Details

#enum_value_descriptor_protoObject (readonly)

The +EnumValueDescriptorProto+ this +EnumValueDescriptor+ is wrapping.



13
14
15
# File 'lib/protobuf_descriptor/enum_value_descriptor.rb', line 13

def enum_value_descriptor_proto
  @enum_value_descriptor_proto
end

#parentObject (readonly)

The containing ProtobufDescriptor::EnumDescriptor that this is a value for.



10
11
12
# File 'lib/protobuf_descriptor/enum_value_descriptor.rb', line 10

def parent
  @parent
end

Instance Method Details

#nameObject

The name of the enum value



21
# File 'lib/protobuf_descriptor/enum_value_descriptor.rb', line 21

def name; enum_value_descriptor_proto.name; end

#numberObject

The number mapped to the enum value



24
# File 'lib/protobuf_descriptor/enum_value_descriptor.rb', line 24

def number; enum_value_descriptor_proto.number; end

#optionsObject

The +EnumValueOptions+ defined for this enum



27
# File 'lib/protobuf_descriptor/enum_value_descriptor.rb', line 27

def options; enum_value_descriptor_proto.options; end