Class: Gapic::Presenters::SnippetPresenter::ParameterPresenter
- Inherits:
-
Object
- Object
- Gapic::Presenters::SnippetPresenter::ParameterPresenter
- Defined in:
- lib/gapic/presenters/snippet/parameter_presenter.rb
Overview
Presentation information about a snippet method parameter
Instance Attribute Summary collapse
-
#description ⇒ String?
readonly
A description of this parameter, or nil if none.
-
#example ⇒ Gapic::Presenters::SnippetPresenter::ExpressionPresenter
readonly
The default/example value for this parameter, as a presenter.
-
#name ⇒ String
readonly
The name of this parameter.
-
#type ⇒ Gapic::Presenters::SnippetPresenter::TypePresenter
readonly
The type of this parameter, as a presenter.
Instance Method Summary collapse
-
#initialize(proto, json) ⇒ ParameterPresenter
constructor
Create an expression presenter.
Constructor Details
#initialize(proto, json) ⇒ ParameterPresenter
Create an expression presenter.
33 34 35 36 37 38 39 |
# File 'lib/gapic/presenters/snippet/parameter_presenter.rb', line 33 def initialize proto, json @name = proto.name @description = proto.description @description = nil if @description&.empty? @type = TypePresenter.new proto&.type, json&.fetch("type", nil) @example = ExpressionPresenter.new proto&.value, json&.fetch("value", nil) end |
Instance Attribute Details
#description ⇒ String? (readonly)
A description of this parameter, or nil if none.
51 52 53 |
# File 'lib/gapic/presenters/snippet/parameter_presenter.rb', line 51 def description @description end |
#example ⇒ Gapic::Presenters::SnippetPresenter::ExpressionPresenter (readonly)
The default/example value for this parameter, as a presenter.
63 64 65 |
# File 'lib/gapic/presenters/snippet/parameter_presenter.rb', line 63 def example @example end |
#name ⇒ String (readonly)
The name of this parameter
45 46 47 |
# File 'lib/gapic/presenters/snippet/parameter_presenter.rb', line 45 def name @name end |
#type ⇒ Gapic::Presenters::SnippetPresenter::TypePresenter (readonly)
The type of this parameter, as a presenter.
57 58 59 |
# File 'lib/gapic/presenters/snippet/parameter_presenter.rb', line 57 def type @type end |