Class: ProtobufDescriptor::EnumDescriptor

Inherits:
Object
  • Object
show all
Includes:
NamedChild
Defined in:
lib/protobuf_descriptor/enum_descriptor.rb

Overview

Describes an enum type.

See href="https://code.google.com/p/protobuf/source/browse/trunk/src/google/protobuf/descriptor.proto#84">

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from NamedChild

#fully_qualified_java_name, #fully_qualified_name, #fully_qualified_ruby_name, #fully_qualified_wire_name

Constructor Details

#initialize(parent, enum_descriptor_proto) ⇒ EnumDescriptor

Returns a new instance of EnumDescriptor.



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

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

Instance Attribute Details

#enum_descriptor_protoObject (readonly)

The EnumDescriptorProto this EnumDescriptor is wrapping.



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

def enum_descriptor_proto
  @enum_descriptor_proto
end

#parentObject (readonly)

The containing FileDescriptor or MessageDescriptor that defines this enum.



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

def parent
  @parent
end

Instance Method Details

#nameObject

The name of the enum



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

def name; enum_descriptor_proto.name; end

#optionsObject

The EnumOptions defined for this enum



31
# File 'lib/protobuf_descriptor/enum_descriptor.rb', line 31

def options; enum_descriptor_proto.options; end

#valueObject Also known as: values

The possible values of the enum



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

def value; enum_descriptor_proto.value; end