Class: Gapic::Presenters::SnippetPresenter::StreamingRequestInitializationPresenter
- Inherits:
-
Object
- Object
- Gapic::Presenters::SnippetPresenter::StreamingRequestInitializationPresenter
- Defined in:
- lib/gapic/presenters/snippet/request_initialization_presenters.rb
Overview
Presentation information about client-streaming request initialization
Instance Attribute Summary collapse
-
#render_postcall ⇒ String
readonly
The post-call rendered code as a single string, possibly with line breaks.
-
#render_postcall_lines ⇒ Array<String>
readonly
The lines of rendered code for after the rpc call.
-
#render_precall ⇒ String
readonly
The pre-call rendered code as a single string, possibly with line breaks.
-
#render_precall_lines ⇒ Array<String>
readonly
The lines of rendered code for before the rpc call.
-
#request_name ⇒ String
readonly
The name of the request variable set.
Instance Method Summary collapse
-
#initialize(proto, json, request_name:, request_type:, phase1:) ⇒ StreamingRequestInitializationPresenter
constructor
Create a streaming request init presenter.
Constructor Details
#initialize(proto, json, request_name:, request_type:, phase1:) ⇒ StreamingRequestInitializationPresenter
Create a streaming request init presenter.
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
# File 'lib/gapic/presenters/snippet/request_initialization_presenters.rb', line 122 def initialize proto, json, request_name:, request_type:, phase1: @request_name = request_name @render_precall_lines = [] @render_precall_lines << "# Create an input stream." if phase1 @render_precall_lines << "#{request_name} = Gapic::StreamInput.new" @render_precall = @render_precall_lines.join "\n" @render_postcall_lines = if proto && json configured_lines proto, json, request_name, request_type else fallback_lines request_name, request_type end @render_postcall = @render_postcall_lines.join "\n" end |
Instance Attribute Details
#render_postcall ⇒ String (readonly)
The post-call rendered code as a single string, possibly with line breaks
160 161 162 |
# File 'lib/gapic/presenters/snippet/request_initialization_presenters.rb', line 160 def render_postcall @render_postcall end |
#render_postcall_lines ⇒ Array<String> (readonly)
The lines of rendered code for after the rpc call
154 155 156 |
# File 'lib/gapic/presenters/snippet/request_initialization_presenters.rb', line 154 def render_postcall_lines @render_postcall_lines end |
#render_precall ⇒ String (readonly)
The pre-call rendered code as a single string, possibly with line breaks
148 149 150 |
# File 'lib/gapic/presenters/snippet/request_initialization_presenters.rb', line 148 def render_precall @render_precall end |
#render_precall_lines ⇒ Array<String> (readonly)
The lines of rendered code for before the rpc call
142 143 144 |
# File 'lib/gapic/presenters/snippet/request_initialization_presenters.rb', line 142 def render_precall_lines @render_precall_lines end |
#request_name ⇒ String (readonly)
The name of the request variable set
166 167 168 |
# File 'lib/gapic/presenters/snippet/request_initialization_presenters.rb', line 166 def request_name @request_name end |