Class: ProtobufDescriptor::EnumValueDescriptor
- Inherits:
-
Object
- Object
- ProtobufDescriptor::EnumValueDescriptor
- Includes:
- HasParent
- Defined in:
- lib/protobuf_descriptor/enum_value_descriptor.rb
Overview
Describes an enum type.
See +EnumValueDescriptorProto+[https://code.google.com/p/protobuf/source/browse/trunk/src/google/protobuf/descriptor.proto#180]
Instance Attribute Summary collapse
-
#enum_value_descriptor_proto ⇒ Object
readonly
The +EnumValueDescriptorProto+ this +EnumValueDescriptor+ is wrapping.
-
#parent ⇒ Object
readonly
The containing EnumDescriptor that this is a value for.
Instance Method Summary collapse
-
#initialize(parent, enum_value_descriptor_proto) ⇒ EnumValueDescriptor
constructor
A new instance of EnumValueDescriptor.
-
#name ⇒ Object
The name of the enum value.
-
#number ⇒ Object
The number mapped to the enum value.
-
#options ⇒ Object
The +EnumValueOptions+ defined for this enum.
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_proto ⇒ Object (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 |
#parent ⇒ Object (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
#name ⇒ Object
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 |
#number ⇒ Object
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 |
#options ⇒ Object
The +EnumValueOptions+ defined for this enum
27 |
# File 'lib/protobuf_descriptor/enum_value_descriptor.rb', line 27 def ; enum_value_descriptor_proto.; end |