Skip to content

Commit

Permalink
Use self instead of class name
Browse files Browse the repository at this point in the history
  • Loading branch information
KMahoney committed Oct 29, 2012
1 parent b4b2d3e commit 8eb9fe0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions gocardless/client.py
Expand Up @@ -69,15 +69,15 @@ def api_get(self, path, **kwargs):
:param path: the path that will be added to the API prefix
"""
return self._request('get', Client.API_PATH + path, **kwargs)
return self._request('get', self.API_PATH + path, **kwargs)

def api_post(self, path, data, **kwargs):
"""Issue a POST request to the API server
:param path: The path that will be added to the API prefix
:param data: The data to post to the url.
"""
return self._request('post', Client.API_PATH + path, data=data,
return self._request('post', self.API_PATH + path, data=data,
**kwargs)

def api_put(self, path, data={}, **kwargs):
Expand All @@ -86,7 +86,7 @@ def api_put(self, path, data={}, **kwargs):
:param path: The path that will be added to the API prefix
:param data: The data to put to the url.
"""
return self._request('put', Client.API_PATH + path, data=data,
return self._request('put', self.API_PATH + path, data=data,
**kwargs)

def api_delete(self, path, **kwargs):
Expand All @@ -95,7 +95,7 @@ def api_delete(self, path, **kwargs):
:param path: the path that will be added to the API prefix
:param params: query string parameters
"""
return self._request('delete', Client.API_PATH + path, **kwargs)
return self._request('delete', self.API_PATH + path, **kwargs)

def _request(self, method, path, **kwargs):
"""
Expand All @@ -104,7 +104,7 @@ def _request(self, method, path, **kwargs):
:param method: the HTTP method to use (e.g. +:get+, +:post+)
:param path: the path fragment of the URL
"""
request_url = Client.get_base_url() + path
request_url = self.get_base_url() + path
request = Request(method, request_url)
logger.debug("Executing request to {0}".format(request_url))

Expand Down

0 comments on commit 8eb9fe0

Please sign in to comment.