google_maps_api-distance_matrix 0.1.1 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b11c66dd2bab535f70004cfbbd22b5dc5380f0fc
|
4
|
+
data.tar.gz: 1df40cb57af2326de439298222b00ab8775432f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a8a24cb2d932c9a49171ed23f06454d880c31bc37a4e88bdc9e9f8435cca4ca762fa91d95047729c1e99cb42f48b39eeae8be8d9d08a1a5189e876147e18c424
|
7
|
+
data.tar.gz: 208c417d9488d7a27decdc6aa33ba77f6eb40775aeb36a1cc247155505b0143fd1795fc09b670e91659aad0415e632a92507f47de3ea5fdbfc1696429dd49e79
|
@@ -95,9 +95,9 @@ class GoogleMapsAPI::DistanceMatrix::Request
|
|
95
95
|
def sign_uri(uri)
|
96
96
|
options = prepared_options
|
97
97
|
GoogleMapsAPI::Core::URISigner.sign(
|
98
|
-
uri.to_s,
|
99
|
-
options[:client],
|
100
|
-
options[:key],
|
98
|
+
uri.to_s,
|
99
|
+
options[:client],
|
100
|
+
options[:key],
|
101
101
|
options[:channel]
|
102
102
|
)
|
103
103
|
end
|
@@ -108,7 +108,7 @@ class GoogleMapsAPI::DistanceMatrix::Request
|
|
108
108
|
|
109
109
|
def arrays_to_coordinate_string(items)
|
110
110
|
items.collect do |i|
|
111
|
-
i.respond_to?(:to_ary) ? i.to_ary.join(",") : i
|
111
|
+
i.respond_to?(:to_ary) ? i.to_ary.join(",") : i
|
112
112
|
end
|
113
113
|
end
|
114
114
|
end
|
@@ -1,23 +1,25 @@
|
|
1
1
|
require "json"
|
2
2
|
|
3
3
|
class GoogleMapsAPI::DistanceMatrix::Response
|
4
|
-
attr_reader :status, :origin_addresses, :destination_addresses, :rows
|
4
|
+
attr_reader :status, :origin_addresses, :destination_addresses, :rows, :json_response
|
5
5
|
|
6
|
-
def initialize(status, origin_addresses, destination_addresses, rows)
|
6
|
+
def initialize(status, origin_addresses, destination_addresses, rows, json_response)
|
7
7
|
@status = status
|
8
8
|
@origin_addresses = origin_addresses
|
9
9
|
@destination_addresses = destination_addresses
|
10
10
|
@rows = rows
|
11
|
+
@json_response = json_response
|
11
12
|
end
|
12
13
|
|
13
14
|
def self.from_json(json)
|
14
15
|
parsed_json = parse_json(json)
|
15
16
|
rows = build_rows(parsed_json)
|
16
17
|
self.new(
|
17
|
-
parsed_json['status'],
|
18
|
-
parsed_json['origin_addresses'],
|
19
|
-
parsed_json['destination_addresses'],
|
20
|
-
rows
|
18
|
+
parsed_json['status'],
|
19
|
+
parsed_json['origin_addresses'],
|
20
|
+
parsed_json['destination_addresses'],
|
21
|
+
rows,
|
22
|
+
json
|
21
23
|
)
|
22
24
|
end
|
23
25
|
|
@@ -21,7 +21,7 @@ describe GoogleMapsAPI::DistanceMatrix::Request do
|
|
21
21
|
end
|
22
22
|
|
23
23
|
it "raises a ResponseError if the response is not successful" do
|
24
|
-
|
24
|
+
allow_any_instance_of(subject.http_adapter).to receive(:request_get).and_return(false)
|
25
25
|
expect { subject.perform }.to raise_error(GoogleMapsAPI::DistanceMatrix::ResponseError)
|
26
26
|
end
|
27
27
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google_maps_api-distance_matrix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Felipe Zavan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|