Class: Gapic::Presenters::EnumPresenter

Inherits:
Object
  • Object
show all
Defined in:
lib/gapic/presenters/enum_presenter.rb

Overview

A presenter for proto enums.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(enum) ⇒ EnumPresenter

Returns a new instance of EnumPresenter.

Parameters:



29
30
31
32
# File 'lib/gapic/presenters/enum_presenter.rb', line 29

def initialize enum
  @enum = enum
  @type = "enum"
end

Instance Attribute Details

#typeString (readonly)

Returns String representation of this presenter type.

Returns:

  • (String)

    String representation of this presenter type.



24
25
26
# File 'lib/gapic/presenters/enum_presenter.rb', line 24

def type
  @type
end

Instance Method Details

#doc_descriptionObject



38
39
40
# File 'lib/gapic/presenters/enum_presenter.rb', line 38

def doc_description
  @enum.docs_leading_comments
end

#is_deprecated?Boolean

Returns Whether the enum is marked as deprecated.

Returns:

  • (Boolean)

    Whether the enum is marked as deprecated.



49
50
51
# File 'lib/gapic/presenters/enum_presenter.rb', line 49

def is_deprecated?
  @enum.is_deprecated?
end

#nameObject



34
35
36
# File 'lib/gapic/presenters/enum_presenter.rb', line 34

def name
  @enum.name
end

#valuesObject



42
43
44
# File 'lib/gapic/presenters/enum_presenter.rb', line 42

def values
  @values ||= @enum.values.map { |v| EnumValuePresenter.new v }
end