Class: Gapic::Presenters::SnippetPresenter::StreamingResponseHandlingPresenter
- Inherits:
-
Object
- Object
- Gapic::Presenters::SnippetPresenter::StreamingResponseHandlingPresenter
- Defined in:
- lib/gapic/presenters/snippet/response_handling_presenters.rb
Overview
Presentation information about server-streaming 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, response_name:, base_response_type:, phase1:) ⇒ StreamingResponseHandlingPresenter
constructor
Create a server-streaming response handling presenter.
Constructor Details
#initialize(proto, json, response_name:, base_response_type:, phase1:) ⇒ StreamingResponseHandlingPresenter
Create a server-streaming response handling presenter
180 181 182 183 184 185 186 187 188 189 190 191 |
# File 'lib/gapic/presenters/snippet/response_handling_presenters.rb', line 180 def initialize proto, json, response_name:, base_response_type:, phase1: @response_name = response_name @render_lines = [] if response_name if phase1 && base_response_type @render_lines << "# The returned object is a streamed enumerable yielding elements of type" @render_lines << "# #{base_response_type}" end @render_lines += per_stream_response_lines proto, json, response_name, phase1 end @render = @render_lines.join "\n" end |
Instance Attribute Details
#render ⇒ String (readonly)
The rendered code as a single string, possibly with line breaks
203 204 205 |
# File 'lib/gapic/presenters/snippet/response_handling_presenters.rb', line 203 def render @render end |
#render_lines ⇒ Array<String> (readonly)
The lines of rendered code
197 198 199 |
# File 'lib/gapic/presenters/snippet/response_handling_presenters.rb', line 197 def render_lines @render_lines end |
#response_name ⇒ String? (readonly)
The name of the response variable, or nil for no response handling
209 210 211 |
# File 'lib/gapic/presenters/snippet/response_handling_presenters.rb', line 209 def response_name @response_name end |