Class: Gapic::Schema::Enum
- Extended by:
- Forwardable
- Defined in:
- lib/gapic/schema/wrappers.rb
Overview
Wrapper for a protobuf enum.
Instance Attribute Summary collapse
-
#values ⇒ Object
readonly
@ return [EnumValue] the EnumValues contained in this file.
Attributes inherited from Proto
#address, #descriptor, #docs, #parent
Instance Method Summary collapse
-
#initialize(descriptor, address, docs, values) ⇒ Enum
constructor
Initializes a message object.
-
#name ⇒ String
The unqualified name of the Enum.
-
#options ⇒ Array<Google::Protobuf::EnumOptions>
The options of the enum.
Methods inherited from Proto
#containing_api, #containing_file, #docs_leading_comments, #leading_comments, #leading_detached_comments, #path, #span, #trailing_comments
Constructor Details
#initialize(descriptor, address, docs, values) ⇒ Enum
Initializes a message object.
523 524 525 526 527 |
# File 'lib/gapic/schema/wrappers.rb', line 523 def initialize descriptor, address, docs, values super descriptor, address, docs @values = values || [] @values.each { |v| v.parent = self } end |
Instance Attribute Details
#values ⇒ Object (readonly)
@ return [EnumValue] the EnumValues contained in this file.
510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 |
# File 'lib/gapic/schema/wrappers.rb', line 510 class Enum < Proto extend Forwardable attr_reader :values # Initializes a message object. # @param descriptor [Google::Protobuf::DescriptorProto] the protobuf # representation of this service. # @param address [Enumerable<String>] The address of the proto. See # #address for more info. # @param docs [Google::Protobuf::SourceCodeInfo::Location] The docs # of the proto. See #docs for more info. # @param values [Enumerable<EnumValue>] The EnumValues of this enum. def initialize descriptor, address, docs, values super descriptor, address, docs @values = values || [] @values.each { |v| v.parent = self } end # @!method name # @return [String] the unqualified name of the Enum. # @!method options # @return [Array<Google::Protobuf::EnumOptions>] the options of the # enum. def_delegators( :descriptor, :name, :options ) end |
Instance Method Details
#name ⇒ String
Returns the unqualified name of the Enum.
534 535 536 537 538 |
# File 'lib/gapic/schema/wrappers.rb', line 534 def_delegators( :descriptor, :name, :options ) |
#options ⇒ Array<Google::Protobuf::EnumOptions>
Returns the options of the enum.
534 535 536 537 538 |
# File 'lib/gapic/schema/wrappers.rb', line 534 def_delegators( :descriptor, :name, :options ) |