Class: Protobuf::Generate::Ast::MessageField

Inherits:
Struct
  • Object
show all
Defined in:
lib/protobuf/generate/parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#labelObject

Returns the value of attribute label

Returns:

  • (Object)

    the current value of label



61
62
63
# File 'lib/protobuf/generate/parser.rb', line 61

def label
  @label
end

#metaObject

Returns the value of attribute meta

Returns:

  • (Object)

    the current value of meta



61
62
63
# File 'lib/protobuf/generate/parser.rb', line 61

def meta
  @meta
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



61
62
63
# File 'lib/protobuf/generate/parser.rb', line 61

def name
  @name
end

#optionsObject

Returns the value of attribute options

Returns:

  • (Object)

    the current value of options



61
62
63
# File 'lib/protobuf/generate/parser.rb', line 61

def options
  @options
end

#tagObject

Returns the value of attribute tag

Returns:

  • (Object)

    the current value of tag



61
62
63
# File 'lib/protobuf/generate/parser.rb', line 61

def tag
  @tag
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



61
62
63
# File 'lib/protobuf/generate/parser.rb', line 61

def type
  @type
end

Instance Method Details

#optional?Boolean

Returns:

  • (Boolean)


63
# File 'lib/protobuf/generate/parser.rb', line 63

def optional?; !required? end

#required?Boolean

Returns:

  • (Boolean)


62
# File 'lib/protobuf/generate/parser.rb', line 62

def required?; !!label.match(/required/) end