Class: Gapic::Presenters::SnippetPresenter::SimpleRequestInitializationPresenter
- Inherits:
-
Object
- Object
- Gapic::Presenters::SnippetPresenter::SimpleRequestInitializationPresenter
- Defined in:
- lib/gapic/presenters/snippet/request_initialization_presenters.rb
Overview
Presentation information about simple 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_type:, phase1:, default_request_name: "request") ⇒ SimpleRequestInitializationPresenter
constructor
Create a simple request init presenter.
Constructor Details
#initialize(proto, json, request_type:, phase1:, default_request_name: "request") ⇒ SimpleRequestInitializationPresenter
Create a simple request init presenter.
36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/gapic/presenters/snippet/request_initialization_presenters.rb', line 36 def initialize proto, json, request_type:, phase1:, default_request_name: "request" @request_name = phase1 ? default_request_name : proto.request_name @render_precall_lines = if proto configured_lines proto, json, request_type else fallback_lines request_type end @render_precall = @render_precall_lines.join "\n" @render_postcall_lines = [] @render_postcall = "" end |
Instance Attribute Details
#render_postcall ⇒ String (readonly)
The post-call rendered code as a single string, possibly with line breaks
71 72 73 |
# File 'lib/gapic/presenters/snippet/request_initialization_presenters.rb', line 71 def render_postcall @render_postcall end |
#render_postcall_lines ⇒ Array<String> (readonly)
The lines of rendered code for after the rpc call
65 66 67 |
# File 'lib/gapic/presenters/snippet/request_initialization_presenters.rb', line 65 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
59 60 61 |
# File 'lib/gapic/presenters/snippet/request_initialization_presenters.rb', line 59 def render_precall @render_precall end |
#render_precall_lines ⇒ Array<String> (readonly)
The lines of rendered code for before the rpc call
53 54 55 |
# File 'lib/gapic/presenters/snippet/request_initialization_presenters.rb', line 53 def render_precall_lines @render_precall_lines end |
#request_name ⇒ String (readonly)
The name of the request variable set
77 78 79 |
# File 'lib/gapic/presenters/snippet/request_initialization_presenters.rb', line 77 def request_name @request_name end |