postcodeinfo-client-ruby 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/postcodeinfo/postcode.rb +2 -2
- data/postcodeinfo-client-ruby.gemspec +2 -2
- data/spec/postcode_spec.rb +9 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a1cc29fc252abb63673bcdbc1eac1e65c44f3afa
|
4
|
+
data.tar.gz: c89795f10cbda5f945032d5df031525ea8a8dce6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84bba1eac23473f8fba00e73bcf59ca43bdc099745f9dceb6e812fa0ffee55c213bd2284e5f1bef328d870ce0a11eb9641419f86b03abd7e0c2904444b13c854
|
7
|
+
data.tar.gz: 8ca4410e0121c5677ed0fcfd4489be16b6fdc2581569d10e792b6bbf5b9ab035118d79f0d3d6ebcb18d51603cf3d2bc84ba1194bd0817dc826d70a2aefac6f52
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.3
|
@@ -51,8 +51,8 @@ module PostcodeInfo
|
|
51
51
|
|
52
52
|
def set_coordinates!(info)
|
53
53
|
if info[:centre]
|
54
|
-
@latitude = info[:centre][:
|
55
|
-
@longitude = info[:centre][:
|
54
|
+
@latitude = info[:centre][:coordinates][0]
|
55
|
+
@longitude = info[:centre][:coordinates][1]
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
@@ -2,11 +2,11 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: postcodeinfo-client-ruby 0.1.
|
5
|
+
# stub: postcodeinfo-client-ruby 0.1.3 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "postcodeinfo-client-ruby"
|
9
|
-
s.version = "0.1.
|
9
|
+
s.version = "0.1.3"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
data/spec/postcode_spec.rb
CHANGED
@@ -197,14 +197,19 @@ describe PostcodeInfo::Postcode do
|
|
197
197
|
|
198
198
|
describe 'set_coordinates!' do
|
199
199
|
context 'when the given info has a :centre key' do
|
200
|
-
let(:info){ {centre: {
|
201
|
-
|
202
|
-
|
200
|
+
let(:info){ {centre: {
|
201
|
+
type: 'Point',
|
202
|
+
coordinates:[1.0, 256.8]
|
203
|
+
}
|
204
|
+
}
|
205
|
+
}
|
206
|
+
|
207
|
+
it 'stores the second coordinate as @latitude' do
|
203
208
|
postcode.send(:set_coordinates!, info)
|
204
209
|
expect(postcode.send(:instance_variable_get, '@latitude')).to eq(1.0)
|
205
210
|
end
|
206
211
|
|
207
|
-
it 'stores the
|
212
|
+
it 'stores the first coordinate as @longitude' do
|
208
213
|
postcode.send(:set_coordinates!, info)
|
209
214
|
expect(postcode.send(:instance_variable_get, '@longitude')).to eq(256.8)
|
210
215
|
end
|