Class: Gapic::Presenters::WrapperServicePresenter
- Inherits:
-
ServicePresenter
- Object
- ServicePresenter
- Gapic::Presenters::WrapperServicePresenter
- Defined in:
- lib/gapic/presenters/wrapper_service_presenter.rb
Overview
A presenter for wrapper services.
Instance Method Summary collapse
- #configure_client_call ⇒ Object
- #create_client_call ⇒ Object
- #credentials_class_xref ⇒ Object
- #factory_method_name ⇒ Object
-
#initialize(*args, **kwargs) ⇒ WrapperServicePresenter
constructor
A new instance of WrapperServicePresenter.
-
#usable_service_presenter ⇒ WrapperServicePresenter, ...
Returns this service presenter if there is a grpc client.
Constructor Details
#initialize(*args, **kwargs) ⇒ WrapperServicePresenter
Returns a new instance of WrapperServicePresenter.
27 28 29 30 |
# File 'lib/gapic/presenters/wrapper_service_presenter.rb', line 27 def initialize *args, **kwargs super(*args, **kwargs) @rest = WrapperServiceRestPresenter.new self, @api end |
Instance Method Details
#configure_client_call ⇒ Object
62 63 64 |
# File 'lib/gapic/presenters/wrapper_service_presenter.rb', line 62 def configure_client_call "#{gem.namespace}.configure" end |
#create_client_call ⇒ Object
58 59 60 |
# File 'lib/gapic/presenters/wrapper_service_presenter.rb', line 58 def create_client_call "#{gem.namespace}.#{factory_method_name}" end |
#credentials_class_xref ⇒ Object
66 67 68 |
# File 'lib/gapic/presenters/wrapper_service_presenter.rb', line 66 def credentials_class_xref "`#{credentials_name_full}`" end |
#factory_method_name ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'lib/gapic/presenters/wrapper_service_presenter.rb', line 32 def factory_method_name @factory_method_name ||= begin method_name = ActiveSupport::Inflector.underscore name suffix = gem.factory_method_suffix method_name = "#{method_name}#{suffix}" unless method_name.end_with? suffix method_name = "#{method_name}_client" if Gapic::RubyInfo.excluded_method_names.include? method_name method_name end end |
#usable_service_presenter ⇒ WrapperServicePresenter, ...
Returns this service presenter if there is a grpc client. Otherwise, returns the corresponding rest service presenter if there isn't a grpc client but there is a rest client. Otherwise, returns nil if there is neither client.
50 51 52 53 54 55 56 |
# File 'lib/gapic/presenters/wrapper_service_presenter.rb', line 50 def usable_service_presenter if @api.generate_grpc_clients? self elsif @api.generate_rest_clients? && methods_rest_bindings? rest end end |