Class: Gapic::Presenters::SnippetPresenter::LroResponseHandlingPresenter
- Inherits:
-
Object
- Object
- Gapic::Presenters::SnippetPresenter::LroResponseHandlingPresenter
- Includes:
- ResponseHandlingPresenterCommon
- Defined in:
- lib/gapic/presenters/snippet/response_handling_presenters.rb
Overview
Presentation information about LRO response handling
Instance Attribute Summary collapse
-
#render ⇒ String
readonly
The rendered code as a single string, possibly with line breaks.
-
#render_lines ⇒ Array<String>
readonly
The lines of rendered code.
-
#response_name ⇒ String?
readonly
The name of the response variable, or nil for no response handling.
Instance Method Summary collapse
-
#initialize(proto, _json, phase1:) ⇒ LroResponseHandlingPresenter
constructor
Create an LRO response handling presenter.
Constructor Details
#initialize(proto, _json, phase1:) ⇒ LroResponseHandlingPresenter
Create an LRO response handling presenter
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/gapic/presenters/snippet/response_handling_presenters.rb', line 98 def initialize proto, _json, phase1: @response_name = compute_response_name proto, phase1 @render_lines = [] if @response_name if phase1 @render_lines << "# The returned object is of type Gapic::Operation. You can use it to" @render_lines << "# check the status of an operation, cancel it, or wait for results." end case proto&.polling_type when :NONE # Do nothing when :ONCE @render_lines += check_once_lines phase1 else @render_lines += wait_response_lines phase1 end end @render = @render_lines.join "\n" end |
Instance Attribute Details
#render ⇒ String (readonly)
The rendered code as a single string, possibly with line breaks
128 129 130 |
# File 'lib/gapic/presenters/snippet/response_handling_presenters.rb', line 128 def render @render end |
#render_lines ⇒ Array<String> (readonly)
The lines of rendered code
122 123 124 |
# File 'lib/gapic/presenters/snippet/response_handling_presenters.rb', line 122 def render_lines @render_lines end |
#response_name ⇒ String? (readonly)
The name of the response variable, or nil for no response handling
134 135 136 |
# File 'lib/gapic/presenters/snippet/response_handling_presenters.rb', line 134 def response_name @response_name end |