Class: Gcloud::Search::APIClient::ResourcePath

Inherits:
Object
  • Object
show all
Defined in:
lib/gcloud/search/api_client.rb

Overview

Return type for DiscoveredApi http verb methods

Direct Known Subclasses

IndexResourcePath

Instance Method Summary collapse

Constructor Details

#initialize(api_name, api_version, resource_root, resource_id_param) ⇒ ResourcePath

:nodoc:



74
75
76
77
78
# File 'lib/gcloud/search/api_client.rb', line 74

def initialize api_name, api_version, resource_root, resource_id_param
  @root = "https://#{api_name}.googleapis.com/#{api_version}" \
          "/projects/{projectId}/#{resource_root}"
  @resource_id_param = resource_id_param
end

Instance Method Details

#api_method(method, path = nil) ⇒ Object



96
97
98
# File 'lib/gcloud/search/api_client.rb', line 96

def api_method method, path = nil
  { method: method, uri: "#{@root}#{path}" }
end

#createObject



80
81
82
# File 'lib/gcloud/search/api_client.rb', line 80

def create
  api_method :post
end

#deleteObject



84
85
86
# File 'lib/gcloud/search/api_client.rb', line 84

def delete
  api_method :delete, "/{docId}"
end

#getObject



88
89
90
# File 'lib/gcloud/search/api_client.rb', line 88

def get
  api_method :get, "/{docId}"
end

#listObject



92
93
94
# File 'lib/gcloud/search/api_client.rb', line 92

def list
  api_method :get
end