ratis 3.6.2 → 3.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG +3 -0
- data/Gemfile.lock +1 -1
- data/lib/ratis/itin_trace.rb +7 -0
- data/lib/ratis/itinerary.rb +1 -1
- data/lib/ratis/plantrip.rb +10 -1
- data/lib/ratis/version.rb +1 -1
- data/spec/ratis/plantrip_spec.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 53e9e63662690f7ab5c3028d71042f6f6dcd6f8e
|
4
|
+
data.tar.gz: 23c0844ed0a8fcad49bb2ed75254511cf4bbb4a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 252fc9a54e7287b8df0bff15922d908d77f0bbcd6e5b4b7b3180f20ba34c945afa3f06a26ea6e6e08406b50e796306c2fd63df1e737400ab844ec1bbbf084da0
|
7
|
+
data.tar.gz: 6dc82b860fcefeab7ecb80e3a349119795c790bac348920baa33709d0a5836c942e210bc515f81bc5a0b66e717c5badc761cbb39683a706242f106f4f0835782
|
data/CHANGELOG
CHANGED
data/Gemfile.lock
CHANGED
data/lib/ratis/itin_trace.rb
CHANGED
@@ -10,9 +10,16 @@ module Ratis
|
|
10
10
|
@legs = response.body.to_array(:itintrace_response, :legs, :leg).map { |l| Hashie::Mash.new l }
|
11
11
|
|
12
12
|
@legs.each do |leg|
|
13
|
+
leg.distance = leg.distance.to_f
|
14
|
+
|
13
15
|
leg.points = leg.to_array(:points, :point).collect do |point|
|
14
16
|
point.split(',').map(&:to_f)
|
15
17
|
end
|
18
|
+
|
19
|
+
leg.stops = leg.to_array(:stops, :stop).collect do |stop|
|
20
|
+
stop.point = stop.point.split(',').map(&:to_f)
|
21
|
+
stop
|
22
|
+
end
|
16
23
|
end
|
17
24
|
end
|
18
25
|
|
data/lib/ratis/itinerary.rb
CHANGED
@@ -12,7 +12,7 @@ module Ratis
|
|
12
12
|
@regular_fare = response[:regularfare].to_f
|
13
13
|
@transit_time = response[:transittime].to_i
|
14
14
|
@trace_info = response[:traceinfo]
|
15
|
-
@legs = response.to_array
|
15
|
+
@legs = response.to_array(:legs, :leg).map { |l| Hashie::Mash.new l }
|
16
16
|
end
|
17
17
|
|
18
18
|
end
|
data/lib/ratis/plantrip.rb
CHANGED
@@ -2,6 +2,15 @@ module Ratis
|
|
2
2
|
|
3
3
|
class Plantrip
|
4
4
|
|
5
|
+
class Input < Hashie::Mash
|
6
|
+
include Hashie::Extensions::Coercion
|
7
|
+
|
8
|
+
coerce_key :originlat, Float
|
9
|
+
coerce_key :originlong, Float
|
10
|
+
coerce_key :destinationlat, Float
|
11
|
+
coerce_key :destinationlong, Float
|
12
|
+
end
|
13
|
+
|
5
14
|
attr_accessor :success, :itineraries, :walkable, :walkadjust, :input, :tid
|
6
15
|
|
7
16
|
def initialize(response)
|
@@ -9,7 +18,7 @@ module Ratis
|
|
9
18
|
|
10
19
|
@walkable = response.body[:walkable]
|
11
20
|
@walkadjust = response.body[:walkadjust]
|
12
|
-
@input = response.body[:plantrip_response][:input]
|
21
|
+
@input = Input.new response.body[:plantrip_response][:input]
|
13
22
|
|
14
23
|
@itineraries = response.to_array(:plantrip_response, :itin).map do |itinerary|
|
15
24
|
Itinerary.new(itinerary)
|
data/lib/ratis/version.rb
CHANGED
data/spec/ratis/plantrip_spec.rb
CHANGED
@@ -56,7 +56,7 @@ describe Ratis::Plantrip do
|
|
56
56
|
expect(plantrip.walkable).to eq(nil)
|
57
57
|
expect(plantrip.walkadjust).to eq(nil)
|
58
58
|
|
59
|
-
input = {
|
59
|
+
input = Ratis::Plantrip::Input.new({
|
60
60
|
:originlat => "33.452082",
|
61
61
|
:originlong => "-112.074374",
|
62
62
|
:originlandmarkid => "0",
|
@@ -82,7 +82,7 @@ describe Ratis::Plantrip do
|
|
82
82
|
:walkincrease => "N",
|
83
83
|
:allows2s => "N",
|
84
84
|
:xmode => "BCFKLRSTX"
|
85
|
-
}
|
85
|
+
})
|
86
86
|
|
87
87
|
HashDiff.diff(plantrip.input, input).should eql []
|
88
88
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ratis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.6.
|
4
|
+
version: 3.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Velocity Labs
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10
|
11
|
+
date: 2014-11-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nesty
|