Skip to content

Commit

Permalink
Add ability to append a resource suffix to the resources
Browse files Browse the repository at this point in the history
  • Loading branch information
colindecarlo committed Feb 11, 2017
1 parent 81d7378 commit 07a73d4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Uhura.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class Uhura
private $api;
private $http;
private $responseHandler;
private $resourceSuffix;

private $resource = [];
private $token = null;
Expand Down Expand Up @@ -43,6 +44,11 @@ public function useResponseHandler($handler)
$this->responseHandler = $handler;
}

public function useResourceSuffix($suffix)
{
$this->resourceSuffix = $suffix;
}

public function useBasicAuthentication($username, $password)
{
$token = base64_encode(sprintf("%s:%s", $username, $password));
Expand Down Expand Up @@ -87,7 +93,7 @@ public function url()

public function getResource()
{
return implode('/', $this->resource);
return implode('/', $this->resource) . $this->resourceSuffix;
}

public function reset()
Expand Down

0 comments on commit 07a73d4

Please sign in to comment.