All files / src/search DriverEtaSearch.js

100% Statements 4/4
50% Branches 2/4
100% Functions 0/0
100% Lines 4/4
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24    1x   1x   1x               1x                  
'use es6';
 
import {Map, Record} from 'immutable';
 
import Coordinate from '../data/Coordinate';
 
let defaults = {
  startCoordinate: new Coordinate(),
  endCoordinate: undefined,
  rideType: undefined,
};
 
export default class DriverEtaSearch extends Record(defaults) {
  toParameters(search) {
    return Map({
      lat: this.startCoordinate.lat,
      lng: this.startCoordinate.lng,
      destination_lat: this.endCoordinate ? this.endCoordinate.lat : undefined,
      destination_lng: this.endCoordinate ? this.endCoordinate.lng : undefined,
      ride_type: this.rideType,
    });
  }
}