Class: ProtoPlugin::EnumValueDescriptor
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- ProtoPlugin::EnumValueDescriptor
- Includes:
- Commentable
- Defined in:
- lib/proto_plugin/enum_value_descriptor.rb
Overview
A wrapper class around Google::Protobuf::EnumValueDescriptorProto which provides helpers and more idiomatic Ruby access patterns.
Any method not defined directly is delegated to the descriptor the wrapper was initialized with.
Instance Attribute Summary collapse
- #descriptor ⇒ Google::Protobuf::EnumValueDescriptorProto readonly
-
#enum ⇒ EnumDescriptor
readonly
The enum descriptor this value was defined within.
Instance Method Summary collapse
-
#file ⇒ FileDescriptor
The file descriptor this enum value belongs to.
-
#full_name ⇒ String
The full name of the enum value, including parent namespace.
-
#initialize(descriptor, enum) ⇒ EnumValueDescriptor
constructor
A new instance of EnumValueDescriptor.
Methods included from Commentable
#comments, #leading_comments, #source_location, #trailing_comments
Constructor Details
#initialize(descriptor, enum) ⇒ EnumValueDescriptor
Returns a new instance of EnumValueDescriptor.
26 27 28 29 30 |
# File 'lib/proto_plugin/enum_value_descriptor.rb', line 26 def initialize(descriptor, enum) super(descriptor) @descriptor = descriptor @enum = enum end |
Instance Attribute Details
#descriptor ⇒ Google::Protobuf::EnumValueDescriptorProto (readonly)
17 18 19 |
# File 'lib/proto_plugin/enum_value_descriptor.rb', line 17 def descriptor @descriptor end |
#enum ⇒ EnumDescriptor (readonly)
The enum descriptor this value was defined within.
22 23 24 |
# File 'lib/proto_plugin/enum_value_descriptor.rb', line 22 def enum @enum end |
Instance Method Details
#file ⇒ FileDescriptor
The file descriptor this enum value belongs to.
35 36 37 |
# File 'lib/proto_plugin/enum_value_descriptor.rb', line 35 def file enum.file end |
#full_name ⇒ String
The full name of the enum value, including parent namespace.
45 46 47 |
# File 'lib/proto_plugin/enum_value_descriptor.rb', line 45 def full_name @full_name ||= "#{enum.full_name}::#{name}" end |