Class: Gapic::Presenters::ServiceRestPresenter
Overview
A presenter for proto service (REST submethods)
Instance Method Summary
collapse
#ensure_absolute_namespace, #fix_namespace, #ruby_namespace, #ruby_namespace_for_address
#fix_file_path, #ruby_file_path, #ruby_file_path_for_namespace
Constructor Details
Returns a new instance of ServiceRestPresenter.
34
35
36
37
|
# File 'lib/gapic/presenters/service_rest_presenter.rb', line 34
def initialize main_service, api
@main_service = main_service
@api = api
end
|
Instance Method Details
#client_file_path ⇒ String
127
128
129
|
# File 'lib/gapic/presenters/service_rest_presenter.rb', line 127
def client_file_path
"#{client_require}.rb"
end
|
#client_name ⇒ String
106
107
108
|
# File 'lib/gapic/presenters/service_rest_presenter.rb', line 106
def client_name
main_service.client_name
end
|
#client_name_full ⇒ String
113
114
115
|
# File 'lib/gapic/presenters/service_rest_presenter.rb', line 113
def client_name_full
fix_namespace api, "#{service_name_full}::#{client_name}"
end
|
#client_require ⇒ String
120
121
122
|
# File 'lib/gapic/presenters/service_rest_presenter.rb', line 120
def client_require
ruby_file_path api, client_name_full
end
|
169
170
171
|
# File 'lib/gapic/presenters/service_rest_presenter.rb', line 169
def configure_client_call
"#{client_name_full}.configure"
end
|
#create_client_call ⇒ String
134
135
136
|
# File 'lib/gapic/presenters/service_rest_presenter.rb', line 134
def create_client_call
"#{client_name_full}.new"
end
|
#credentials_class_xref ⇒ String
162
163
164
|
# File 'lib/gapic/presenters/service_rest_presenter.rb', line 162
def credentials_class_xref
main_service.credentials_class_xref
end
|
234
235
236
|
# File 'lib/gapic/presenters/service_rest_presenter.rb', line 234
def methods
main_service.methods
end
|
#name ⇒ String
Ruby name of this service
44
45
46
|
# File 'lib/gapic/presenters/service_rest_presenter.rb', line 44
def name
main_service.name
end
|
#nonstandard_lro_file_name ⇒ String
File name of the nonstandard LRO module
205
206
207
|
# File 'lib/gapic/presenters/service_rest_presenter.rb', line 205
def nonstandard_lro_file_name
nonstandard_lro_file_path.split("/").last
end
|
#nonstandard_lro_file_path ⇒ String
Full file path to the nonstandard LRO module
196
197
198
|
# File 'lib/gapic/presenters/service_rest_presenter.rb', line 196
def nonstandard_lro_file_path
"#{nonstandard_lro_require}.rb"
end
|
#nonstandard_lro_name ⇒ String
Name of the nonstandard LRO module
178
179
180
|
# File 'lib/gapic/presenters/service_rest_presenter.rb', line 178
def nonstandard_lro_name
"NonstandardLro"
end
|
#nonstandard_lro_name_full ⇒ String
Full name of the nonstandard LRO module
187
188
189
|
# File 'lib/gapic/presenters/service_rest_presenter.rb', line 187
def nonstandard_lro_name_full
fix_namespace @api, "#{service_name_full}::#{nonstandard_lro_name}"
end
|
#nonstandard_lro_require ⇒ String
The require string for the nonstandard LRO module
214
215
216
|
# File 'lib/gapic/presenters/service_rest_presenter.rb', line 214
def nonstandard_lro_require
ruby_file_path @api, "#{service_name_full}::#{nonstandard_lro_name}"
end
|
The method to use for quick start samples. Normally this is simply the
first non-client-streaming method defined, but it can be overridden via
a gem config.
227
228
229
|
# File 'lib/gapic/presenters/service_rest_presenter.rb', line 227
def quick_start_method
main_service.quick_start_method&.rest
end
|
#service_directory_name ⇒ String
Folder name for this service
71
72
73
|
# File 'lib/gapic/presenters/service_rest_presenter.rb', line 71
def service_directory_name
service_require.split("/")[-2]
end
|
#service_name_full ⇒ String
Full Ruby name of this service
53
54
55
|
# File 'lib/gapic/presenters/service_rest_presenter.rb', line 53
def service_name_full
fix_namespace api, "#{main_service.service_name_full}::Rest"
end
|
#service_require ⇒ String
Require path for this service
62
63
64
|
# File 'lib/gapic/presenters/service_rest_presenter.rb', line 62
def service_require
ruby_file_path @api, service_name_full
end
|
#service_rest_file_path ⇒ String
148
149
150
|
# File 'lib/gapic/presenters/service_rest_presenter.rb', line 148
def service_rest_file_path
"#{service_rest_require}.rb"
end
|
#service_rest_require ⇒ String
141
142
143
|
# File 'lib/gapic/presenters/service_rest_presenter.rb', line 141
def service_rest_require
ruby_file_path api, service_name_full
end
|
#service_stub_file_path ⇒ String
99
100
101
|
# File 'lib/gapic/presenters/service_rest_presenter.rb', line 99
def service_stub_file_path
"#{service_stub_require}.rb"
end
|
#service_stub_name ⇒ String
78
79
80
|
# File 'lib/gapic/presenters/service_rest_presenter.rb', line 78
def service_stub_name
"ServiceStub"
end
|
#service_stub_name_full ⇒ String
85
86
87
|
# File 'lib/gapic/presenters/service_rest_presenter.rb', line 85
def service_stub_name_full
fix_namespace api, "#{service_name_full}::#{service_stub_name}"
end
|
#service_stub_require ⇒ String
92
93
94
|
# File 'lib/gapic/presenters/service_rest_presenter.rb', line 92
def service_stub_require
ruby_file_path api, service_stub_name_full
end
|
#test_client_file_path ⇒ String
155
156
157
|
# File 'lib/gapic/presenters/service_rest_presenter.rb', line 155
def test_client_file_path
main_service.service_file_path.sub ".rb", "_test.rb"
end
|