Class: Routing::Adapter::Test

Inherits:
Object
  • Object
show all
Defined in:
lib/routing/adapter/test.rb

Overview

Simple test adapter, that returns an array of GeoPoints with values which are based on the ones it recieved.

Instance Method Summary collapse

Instance Method Details

#calculate(geo_points) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/routing/adapter/test.rb', line 8

def calculate(geo_points)
  geo_points.collect do |point|
    GeoPoint.new(
      :lat => point.lat,
      :lng => point.lng,
      :original_lat => point.lat,
      :original_lng => point.lng,
      :relative_time => 100,
      :distance => 100,
      :waypoint => true
    )
  end
end