module Protobuf::Descriptor

def self.label2id(label)

def self.label2id(label)
  require 'protobuf/descriptor/descriptor_proto'
  case label
  when :required then
    Google::Protobuf::FieldDescriptorProto::Label::LABEL_REQUIRED
  when :optional then
    Google::Protobuf::FieldDescriptorProto::Label::LABEL_OPTIONAL
  when :repeated then
    Google::Protobuf::FieldDescriptorProto::Label::LABEL_REPEATED
  else
    raise ArgumentError, "Invalid label: #{label}"
  end
end