Skip to content

Commit

Permalink
refactor(uber-service): rename uber client class variable
Browse files Browse the repository at this point in the history
  • Loading branch information
jaebradley committed Jun 12, 2018
1 parent 3c28ac3 commit b8cc1ba
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/services/UberService.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ import DistanceUnit from '../data/DistanceUnit';

export default class UberService {
constructor() {
this.uberClient = new UberEstimatesClient({ serverToken: 'We0MNCaIpx00F_TUopt4jgL9BzW3bWWt16aYM4mh' });
this.uberEstimatesClient = new UberEstimatesClient({ serverToken: 'We0MNCaIpx00F_TUopt4jgL9BzW3bWWt16aYM4mh' });
this.addressLocator = new AddressLocator();
}

async getTimeEstimates(address) {
const location = await this.addressLocator.getFirstLocation(address);
const timeEstimates = await this.uberClient.getExpectedTimeOfArrival({ start: location.coordinate });
const timeEstimates = await this.uberEstimatesClient.getExpectedTimeOfArrival({
start: location.coordinate,
});
return {
location,
estimates: timeEstimates.times.map(estimate => ({
Expand All @@ -30,7 +32,7 @@ export default class UberService {
this.addressLocator.getFirstLocation(startAddress),
this.addressLocator.getFirstLocation(endAddress),
]);
const estimates = await this.uberClient.getPrices({
const estimates = await this.uberEstimatesClient.getPrices({
start: start.coordinate,
end: end.coordinate,
});
Expand Down

0 comments on commit b8cc1ba

Please sign in to comment.