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: ee7184a967b9259da6b107ba8d98045dff588d32
4
- data.tar.gz: b7037b7503ab5851c8fddf2b28f66c21024d7cf7
3
+ metadata.gz: b11c66dd2bab535f70004cfbbd22b5dc5380f0fc
4
+ data.tar.gz: 1df40cb57af2326de439298222b00ab8775432f9
5
5
  SHA512:
6
- metadata.gz: 28a405fef80038efc362d759d38e0ecae345c9d136015b2073caba15c372042a95c7ac49f68c2c67a5605175ad0b918d0b5c33170ca872fb4b954e4502de6a6a
7
- data.tar.gz: 167e3005ee27f2e8945338fdbbbda96ebce7784ce2299a1062cdc8086c9cc79191f85e9fc04dbdfa3c0144696da54c3e38039dd65a910154c9d50626321362f2
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
 
@@ -1,5 +1,5 @@
1
1
  module GoogleMapsAPI
2
2
  module DistanceMatrix
3
- VERSION = "0.1.1"
3
+ VERSION = "0.2.1"
4
4
  end
5
5
  end
@@ -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
- allow(subject.http_adapter).to receive(:get_response).and_return(false)
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.1.1
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-08-17 00:00:00.000000000 Z
11
+ date: 2014-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler