Class: Google::Protobuf::Internal::EnumBuilder
- Defined in:
- lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/google-protobuf-3.21.12-x86_64-linux/lib/google/protobuf/descriptor_dsl.rb
Instance Method Summary collapse
-
#initialize(name, file_proto) ⇒ EnumBuilder
constructor
A new instance of EnumBuilder.
- #value(name, number) ⇒ Object
Constructor Details
#initialize(name, file_proto) ⇒ EnumBuilder
Returns a new instance of EnumBuilder.
438 439 440 441 442 443 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/google-protobuf-3.21.12-x86_64-linux/lib/google/protobuf/descriptor_dsl.rb', line 438 def initialize(name, file_proto) @enum_proto = Google::Protobuf::EnumDescriptorProto.new( :name => name ) file_proto.enum_type << @enum_proto end |
Instance Method Details
#value(name, number) ⇒ Object
445 446 447 448 449 450 451 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/google-protobuf-3.21.12-x86_64-linux/lib/google/protobuf/descriptor_dsl.rb', line 445 def value(name, number) enum_value_proto = Google::Protobuf::EnumValueDescriptorProto.new( name: name, number: number ) @enum_proto.value << enum_value_proto end |