Class: Gcloud::Search::APIClient
- Inherits:
-
Object
- Object
- Gcloud::Search::APIClient
- Defined in:
- lib/gcloud/search/api_client.rb
Overview
Temporary substitute for Google::APIClient. Once the Search API is discoverable, initialization of this class in Connection should be replaced with the Google API Client.
Defined Under Namespace
Classes: DiscoveredApi, IndexResourcePath, ResourcePath
Instance Attribute Summary collapse
-
#authorization ⇒ Object
:nodoc:.
-
#connection ⇒ Object
:nodoc:.
Instance Method Summary collapse
- #discovered_api(name, version) ⇒ Object
- #execute(options) ⇒ Object
-
#initialize(_options) ⇒ APIClient
constructor
Creates a new APIClient instance.
- #inspect ⇒ Object
Constructor Details
#initialize(_options) ⇒ APIClient
Creates a new APIClient instance.
30 31 32 33 |
# File 'lib/gcloud/search/api_client.rb', line 30 def initialize @connection = Faraday.new request: { params_encoder: Faraday::FlatParamsEncoder } end |
Instance Attribute Details
#authorization ⇒ Object
:nodoc:
26 27 28 |
# File 'lib/gcloud/search/api_client.rb', line 26 def @authorization end |
#connection ⇒ Object
:nodoc:
26 27 28 |
# File 'lib/gcloud/search/api_client.rb', line 26 def connection @connection end |
Instance Method Details
#discovered_api(name, version) ⇒ Object
35 36 37 |
# File 'lib/gcloud/search/api_client.rb', line 35 def discovered_api name, version DiscoveredApi.new name, version end |
#execute(options) ⇒ Object
39 40 41 42 43 |
# File 'lib/gcloud/search/api_client.rb', line 39 def execute api_method = [:api_method] uri = generate_search_uri api_method[:uri], run api_method[:method], uri, end |
#inspect ⇒ Object
45 46 47 |
# File 'lib/gcloud/search/api_client.rb', line 45 def inspect "#{self.class}(#{@project})" end |