Class: Gapic::Presenters::SnippetPresenter::ClientCallPresenter
- Inherits:
-
Object
- Object
- Gapic::Presenters::SnippetPresenter::ClientCallPresenter
- Defined in:
- lib/gapic/presenters/snippet/client_call_presenter.rb
Overview
Presentation information about client call invocation
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.
Instance Method Summary collapse
-
#initialize(proto, json, method_name:, request_name:, response_name:, client_streaming:, server_streaming:, phase1:) ⇒ ClientCallPresenter
constructor
Create a client call presenter.
Constructor Details
#initialize(proto, json, method_name:, request_name:, response_name:, client_streaming:, server_streaming:, phase1:) ⇒ ClientCallPresenter
Create a client call presenter
39 40 41 42 43 44 45 46 |
# File 'lib/gapic/presenters/snippet/client_call_presenter.rb', line 39 def initialize proto, json, method_name:, request_name:, response_name:, client_streaming:, server_streaming:, phase1: @render_lines = pre_call_lines proto, json, method_name, client_streaming, server_streaming, phase1 main_line = "client.#{method_name} #{request_name}" main_line = "#{response_name} = #{main_line}" if response_name @render_lines << main_line @render = @render_lines.join "\n" end |
Instance Attribute Details
#render ⇒ String (readonly)
The rendered code as a single string, possibly with line breaks
58 59 60 |
# File 'lib/gapic/presenters/snippet/client_call_presenter.rb', line 58 def render @render end |
#render_lines ⇒ Array<String> (readonly)
The lines of rendered code
52 53 54 |
# File 'lib/gapic/presenters/snippet/client_call_presenter.rb', line 52 def render_lines @render_lines end |